@@ -139,7 +139,7 @@ static struct used_atom {
139
139
struct {
140
140
enum { O_FULL , O_LENGTH , O_SHORT } option ;
141
141
unsigned int length ;
142
- } objectname ;
142
+ } oid ;
143
143
struct email_option {
144
144
enum { EO_RAW , EO_TRIM , EO_LOCALPART } option ;
145
145
} email_option ;
@@ -361,20 +361,20 @@ static int contents_atom_parser(const struct ref_format *format, struct used_ato
361
361
return 0 ;
362
362
}
363
363
364
- static int objectname_atom_parser (const struct ref_format * format , struct used_atom * atom ,
365
- const char * arg , struct strbuf * err )
364
+ static int oid_atom_parser (const struct ref_format * format , struct used_atom * atom ,
365
+ const char * arg , struct strbuf * err )
366
366
{
367
367
if (!arg )
368
- atom -> u .objectname .option = O_FULL ;
368
+ atom -> u .oid .option = O_FULL ;
369
369
else if (!strcmp (arg , "short" ))
370
- atom -> u .objectname .option = O_SHORT ;
370
+ atom -> u .oid .option = O_SHORT ;
371
371
else if (skip_prefix (arg , "short=" , & arg )) {
372
- atom -> u .objectname .option = O_LENGTH ;
373
- if (strtoul_ui (arg , 10 , & atom -> u .objectname .length ) ||
374
- atom -> u .objectname .length == 0 )
372
+ atom -> u .oid .option = O_LENGTH ;
373
+ if (strtoul_ui (arg , 10 , & atom -> u .oid .length ) ||
374
+ atom -> u .oid .length == 0 )
375
375
return strbuf_addf_ret (err , -1 , _ ("positive value expected '%s' in %%(%s)" ), arg , atom -> name );
376
- if (atom -> u .objectname .length < MINIMUM_ABBREV )
377
- atom -> u .objectname .length = MINIMUM_ABBREV ;
376
+ if (atom -> u .oid .length < MINIMUM_ABBREV )
377
+ atom -> u .oid .length = MINIMUM_ABBREV ;
378
378
} else
379
379
return strbuf_addf_ret (err , -1 , _ ("unrecognized argument '%s' in %%(%s)" ), arg , atom -> name );
380
380
return 0 ;
@@ -495,7 +495,7 @@ static struct {
495
495
{ "refname" , SOURCE_NONE , FIELD_STR , refname_atom_parser },
496
496
{ "objecttype" , SOURCE_OTHER , FIELD_STR , objecttype_atom_parser },
497
497
{ "objectsize" , SOURCE_OTHER , FIELD_ULONG , objectsize_atom_parser },
498
- { "objectname" , SOURCE_OTHER , FIELD_STR , objectname_atom_parser },
498
+ { "objectname" , SOURCE_OTHER , FIELD_STR , oid_atom_parser },
499
499
{ "deltabase" , SOURCE_OTHER , FIELD_STR , deltabase_atom_parser },
500
500
{ "tree" , SOURCE_OBJ },
501
501
{ "parent" , SOURCE_OBJ },
@@ -918,26 +918,26 @@ int verify_ref_format(struct ref_format *format)
918
918
return 0 ;
919
919
}
920
920
921
- static const char * do_grab_objectname (const char * field , const struct object_id * oid ,
922
- struct used_atom * atom )
921
+ static const char * do_grab_oid (const char * field , const struct object_id * oid ,
922
+ struct used_atom * atom )
923
923
{
924
- switch (atom -> u .objectname .option ) {
924
+ switch (atom -> u .oid .option ) {
925
925
case O_FULL :
926
926
return oid_to_hex (oid );
927
927
case O_LENGTH :
928
- return find_unique_abbrev (oid , atom -> u .objectname .length );
928
+ return find_unique_abbrev (oid , atom -> u .oid .length );
929
929
case O_SHORT :
930
930
return find_unique_abbrev (oid , DEFAULT_ABBREV );
931
931
default :
932
932
BUG ("unknown %%(%s) option" , field );
933
933
}
934
934
}
935
935
936
- static int grab_objectname (const char * name , const char * field , const struct object_id * oid ,
937
- struct atom_value * v , struct used_atom * atom )
936
+ static int grab_oid (const char * name , const char * field , const struct object_id * oid ,
937
+ struct atom_value * v , struct used_atom * atom )
938
938
{
939
939
if (starts_with (name , field )) {
940
- v -> s = xstrdup (do_grab_objectname (field , oid , atom ));
940
+ v -> s = xstrdup (do_grab_oid (field , oid , atom ));
941
941
return 1 ;
942
942
}
943
943
return 0 ;
@@ -966,7 +966,7 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_
966
966
} else if (!strcmp (name , "deltabase" ))
967
967
v -> s = xstrdup (oid_to_hex (& oi -> delta_base_oid ));
968
968
else if (deref )
969
- grab_objectname (name , "objectname" , & oi -> oid , v , & used_atom [i ]);
969
+ grab_oid (name , "objectname" , & oi -> oid , v , & used_atom [i ]);
970
970
}
971
971
}
972
972
@@ -1746,7 +1746,7 @@ static int populate_value(struct ref_array_item *ref, struct strbuf *err)
1746
1746
v -> s = xstrdup (buf + 1 );
1747
1747
}
1748
1748
continue ;
1749
- } else if (!deref && grab_objectname (name , "objectname" , & ref -> objectname , v , atom )) {
1749
+ } else if (!deref && grab_oid (name , "objectname" , & ref -> objectname , v , atom )) {
1750
1750
continue ;
1751
1751
} else if (!strcmp (name , "HEAD" )) {
1752
1752
if (atom -> u .head && !strcmp (ref -> refname , atom -> u .head ))
0 commit comments