@@ -1794,7 +1794,8 @@ static void add_message_grep(struct rev_info *revs, const char *pattern)
17941794}
17951795
17961796static int handle_revision_opt (struct rev_info * revs , int argc , const char * * argv ,
1797- int * unkc , const char * * unkv )
1797+ int * unkc , const char * * unkv ,
1798+ const struct setup_revision_opt * opt )
17981799{
17991800 const char * arg = argv [0 ];
18001801 const char * optarg ;
@@ -2154,7 +2155,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
21542155 revs -> limited = 1 ;
21552156 } else if (!strcmp (arg , "--ignore-missing" )) {
21562157 revs -> ignore_missing = 1 ;
2157- } else if (revs -> allow_exclude_promisor_objects_opt &&
2158+ } else if (opt && opt -> allow_exclude_promisor_objects &&
21582159 !strcmp (arg , "--exclude-promisor-objects" )) {
21592160 if (fetch_if_missing )
21602161 BUG ("exclude_promisor_objects can only be used when fetch_if_missing is 0" );
@@ -2176,7 +2177,7 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
21762177 const char * const usagestr [])
21772178{
21782179 int n = handle_revision_opt (revs , ctx -> argc , ctx -> argv ,
2179- & ctx -> cpidx , ctx -> out );
2180+ & ctx -> cpidx , ctx -> out , NULL );
21802181 if (n <= 0 ) {
21812182 error ("unknown option `%s'" , ctx -> argv [0 ]);
21822183 usage_with_options (usagestr , options );
@@ -2394,7 +2395,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
23942395 continue ;
23952396 }
23962397
2397- opts = handle_revision_opt (revs , argc - i , argv + i , & left , argv );
2398+ opts = handle_revision_opt (revs , argc - i , argv + i ,
2399+ & left , argv , opt );
23982400 if (opts > 0 ) {
23992401 i += opts - 1 ;
24002402 continue ;
0 commit comments