@@ -33,8 +33,8 @@ struct if_then_else {
3333};
3434
3535struct refname_atom {
36- enum { R_NORMAL , R_SHORT , R_STRIP } option ;
37- unsigned int strip ;
36+ enum { R_NORMAL , R_SHORT , R_LSTRIP } option ;
37+ unsigned int lstrip ;
3838};
3939
4040/*
@@ -91,10 +91,10 @@ static void refname_atom_parser_internal(struct refname_atom *atom,
9191 atom -> option = R_NORMAL ;
9292 else if (!strcmp (arg , "short" ))
9393 atom -> option = R_SHORT ;
94- else if (skip_prefix (arg , "strip =" , & arg )) {
95- atom -> option = R_STRIP ;
96- if (strtoul_ui (arg , 10 , & atom -> strip ) || atom -> strip <= 0 )
97- die (_ ("positive value expected refname:strip =%s" ), arg );
94+ else if (skip_prefix (arg , "lstrip =" , & arg )) {
95+ atom -> option = R_LSTRIP ;
96+ if (strtoul_ui (arg , 10 , & atom -> lstrip ) || atom -> lstrip <= 0 )
97+ die (_ ("positive value expected refname:lstrip =%s" ), arg );
9898 } else
9999 die (_ ("unrecognized %%(%s) argument: %s" ), name , arg );
100100}
@@ -1091,15 +1091,15 @@ static inline char *copy_advance(char *dst, const char *src)
10911091 return dst ;
10921092}
10931093
1094- static const char * strip_ref_components (const char * refname , unsigned int len )
1094+ static const char * lstrip_ref_components (const char * refname , unsigned int len )
10951095{
10961096 long remaining = len ;
10971097 const char * start = refname ;
10981098
10991099 while (remaining ) {
11001100 switch (* start ++ ) {
11011101 case '\0' :
1102- die (_ ("ref '%s' does not have %ud components to :strip " ),
1102+ die (_ ("ref '%s' does not have %ud components to :lstrip " ),
11031103 refname , len );
11041104 case '/' :
11051105 remaining -- ;
@@ -1113,8 +1113,8 @@ static const char *show_ref(struct refname_atom *atom, const char *refname)
11131113{
11141114 if (atom -> option == R_SHORT )
11151115 return shorten_unambiguous_ref (refname , warn_ambiguous_refs );
1116- else if (atom -> option == R_STRIP )
1117- return strip_ref_components (refname , atom -> strip );
1116+ else if (atom -> option == R_LSTRIP )
1117+ return lstrip_ref_components (refname , atom -> lstrip );
11181118 else
11191119 return refname ;
11201120}
0 commit comments