@@ -719,17 +719,17 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
719
719
for_each_ref (show_reference , NULL );
720
720
continue ;
721
721
}
722
- if (starts_with (arg , "--disambiguate=" )) {
723
- for_each_abbrev (arg + 15 , show_abbrev , NULL );
722
+ if (skip_prefix (arg , "--disambiguate=" , & arg )) {
723
+ for_each_abbrev (arg , show_abbrev , NULL );
724
724
continue ;
725
725
}
726
726
if (!strcmp (arg , "--bisect" )) {
727
727
for_each_ref_in ("refs/bisect/bad" , show_reference , NULL );
728
728
for_each_ref_in ("refs/bisect/good" , anti_reference , NULL );
729
729
continue ;
730
730
}
731
- if (starts_with (arg , "--branches=" )) {
732
- for_each_glob_ref_in (show_reference , arg + 11 ,
731
+ if (skip_prefix (arg , "--branches=" , & arg )) {
732
+ for_each_glob_ref_in (show_reference , arg ,
733
733
"refs/heads/" , NULL );
734
734
clear_ref_exclusion (& ref_excludes );
735
735
continue ;
@@ -739,8 +739,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
739
739
clear_ref_exclusion (& ref_excludes );
740
740
continue ;
741
741
}
742
- if (starts_with (arg , "--tags=" )) {
743
- for_each_glob_ref_in (show_reference , arg + 7 ,
742
+ if (skip_prefix (arg , "--tags=" , & arg )) {
743
+ for_each_glob_ref_in (show_reference , arg ,
744
744
"refs/tags/" , NULL );
745
745
clear_ref_exclusion (& ref_excludes );
746
746
continue ;
@@ -750,13 +750,13 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
750
750
clear_ref_exclusion (& ref_excludes );
751
751
continue ;
752
752
}
753
- if (starts_with (arg , "--glob=" )) {
754
- for_each_glob_ref (show_reference , arg + 7 , NULL );
753
+ if (skip_prefix (arg , "--glob=" , & arg )) {
754
+ for_each_glob_ref (show_reference , arg , NULL );
755
755
clear_ref_exclusion (& ref_excludes );
756
756
continue ;
757
757
}
758
- if (starts_with (arg , "--remotes=" )) {
759
- for_each_glob_ref_in (show_reference , arg + 10 ,
758
+ if (skip_prefix (arg , "--remotes=" , & arg )) {
759
+ for_each_glob_ref_in (show_reference , arg ,
760
760
"refs/remotes/" , NULL );
761
761
clear_ref_exclusion (& ref_excludes );
762
762
continue ;
@@ -766,8 +766,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
766
766
clear_ref_exclusion (& ref_excludes );
767
767
continue ;
768
768
}
769
- if (starts_with (arg , "--exclude=" )) {
770
- add_ref_exclusion (& ref_excludes , arg + 10 );
769
+ if (skip_prefix (arg , "--exclude=" , & arg )) {
770
+ add_ref_exclusion (& ref_excludes , arg );
771
771
continue ;
772
772
}
773
773
if (!strcmp (arg , "--show-toplevel" )) {
@@ -849,20 +849,20 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
849
849
}
850
850
continue ;
851
851
}
852
- if (starts_with (arg , "--since=" )) {
853
- show_datestring ("--max-age=" , arg + 8 );
852
+ if (skip_prefix (arg , "--since=" , & arg )) {
853
+ show_datestring ("--max-age=" , arg );
854
854
continue ;
855
855
}
856
- if (starts_with (arg , "--after=" )) {
857
- show_datestring ("--max-age=" , arg + 8 );
856
+ if (skip_prefix (arg , "--after=" , & arg )) {
857
+ show_datestring ("--max-age=" , arg );
858
858
continue ;
859
859
}
860
- if (starts_with (arg , "--before=" )) {
861
- show_datestring ("--min-age=" , arg + 9 );
860
+ if (skip_prefix (arg , "--before=" , & arg )) {
861
+ show_datestring ("--min-age=" , arg );
862
862
continue ;
863
863
}
864
- if (starts_with (arg , "--until=" )) {
865
- show_datestring ("--min-age=" , arg + 8 );
864
+ if (skip_prefix (arg , "--until=" , & arg )) {
865
+ show_datestring ("--min-age=" , arg );
866
866
continue ;
867
867
}
868
868
if (show_flag (arg ) && verify )
0 commit comments