@@ -2099,20 +2099,20 @@ static int handle_revision_pseudo_opt(const char *submodule,
20992099 } else if ((argcount = parse_long_opt ("exclude" , argv , & optarg ))) {
21002100 add_ref_exclusion (& revs -> ref_excludes , optarg );
21012101 return argcount ;
2102- } else if (starts_with (arg , "--branches=" )) {
2102+ } else if (skip_prefix (arg , "--branches=" , & optarg )) {
21032103 struct all_refs_cb cb ;
21042104 init_all_refs_cb (& cb , revs , * flags );
2105- for_each_glob_ref_in (handle_one_ref , arg + 11 , "refs/heads/" , & cb );
2105+ for_each_glob_ref_in (handle_one_ref , optarg , "refs/heads/" , & cb );
21062106 clear_ref_exclusion (& revs -> ref_excludes );
2107- } else if (starts_with (arg , "--tags=" )) {
2107+ } else if (skip_prefix (arg , "--tags=" , & optarg )) {
21082108 struct all_refs_cb cb ;
21092109 init_all_refs_cb (& cb , revs , * flags );
2110- for_each_glob_ref_in (handle_one_ref , arg + 7 , "refs/tags/" , & cb );
2110+ for_each_glob_ref_in (handle_one_ref , optarg , "refs/tags/" , & cb );
21112111 clear_ref_exclusion (& revs -> ref_excludes );
2112- } else if (starts_with (arg , "--remotes=" )) {
2112+ } else if (skip_prefix (arg , "--remotes=" , & optarg )) {
21132113 struct all_refs_cb cb ;
21142114 init_all_refs_cb (& cb , revs , * flags );
2115- for_each_glob_ref_in (handle_one_ref , arg + 10 , "refs/remotes/" , & cb );
2115+ for_each_glob_ref_in (handle_one_ref , optarg , "refs/remotes/" , & cb );
21162116 clear_ref_exclusion (& revs -> ref_excludes );
21172117 } else if (!strcmp (arg , "--reflog" )) {
21182118 add_reflogs_to_pending (revs , * flags );
@@ -2122,14 +2122,14 @@ static int handle_revision_pseudo_opt(const char *submodule,
21222122 * flags ^= UNINTERESTING | BOTTOM ;
21232123 } else if (!strcmp (arg , "--no-walk" )) {
21242124 revs -> no_walk = REVISION_WALK_NO_WALK_SORTED ;
2125- } else if (starts_with (arg , "--no-walk=" )) {
2125+ } else if (skip_prefix (arg , "--no-walk=" , & optarg )) {
21262126 /*
21272127 * Detached form ("--no-walk X" as opposed to "--no-walk=X")
21282128 * not allowed, since the argument is optional.
21292129 */
2130- if (!strcmp (arg + 10 , "sorted" ))
2130+ if (!strcmp (optarg , "sorted" ))
21312131 revs -> no_walk = REVISION_WALK_NO_WALK_SORTED ;
2132- else if (!strcmp (arg + 10 , "unsorted" ))
2132+ else if (!strcmp (optarg , "unsorted" ))
21332133 revs -> no_walk = REVISION_WALK_NO_WALK_UNSORTED ;
21342134 else
21352135 return error ("invalid argument to --no-walk" );
0 commit comments