@@ -31,12 +31,12 @@ struct ref_sort {
31
31
unsigned reverse : 1 ;
32
32
};
33
33
34
- struct refinfo {
35
- char * refname ;
34
+ struct ref_array_item {
36
35
unsigned char objectname [20 ];
37
36
int flag ;
38
37
const char * symref ;
39
38
struct atom_value * value ;
39
+ char * refname ;
40
40
};
41
41
42
42
static struct {
@@ -86,7 +86,7 @@ static struct {
86
86
* a "*" to denote deref_tag().
87
87
*
88
88
* We parse given format string and sort specifiers, and make a list
89
- * of properties that we need to extract out of objects. refinfo
89
+ * of properties that we need to extract out of objects. ref_array_item
90
90
* structure will hold an array of values extracted that can be
91
91
* indexed with the "atom number", which is an index into this
92
92
* array.
@@ -623,7 +623,7 @@ static inline char *copy_advance(char *dst, const char *src)
623
623
/*
624
624
* Parse the object referred by ref, and grab needed value.
625
625
*/
626
- static void populate_value (struct refinfo * ref )
626
+ static void populate_value (struct ref_array_item * ref )
627
627
{
628
628
void * buf ;
629
629
struct object * obj ;
@@ -835,7 +835,7 @@ static void populate_value(struct refinfo *ref)
835
835
* Given a ref, return the value for the atom. This lazily gets value
836
836
* out of the object by calling populate value.
837
837
*/
838
- static void get_value (struct refinfo * ref , int atom , struct atom_value * * v )
838
+ static void get_value (struct ref_array_item * ref , int atom , struct atom_value * * v )
839
839
{
840
840
if (!ref -> value ) {
841
841
populate_value (ref );
@@ -845,7 +845,7 @@ static void get_value(struct refinfo *ref, int atom, struct atom_value **v)
845
845
}
846
846
847
847
struct grab_ref_cbdata {
848
- struct refinfo * * grab_array ;
848
+ struct ref_array_item * * grab_array ;
849
849
const char * * grab_pattern ;
850
850
int grab_cnt ;
851
851
};
@@ -875,12 +875,12 @@ static int match_name_as_path(const char **pattern, const char *refname)
875
875
return 0 ;
876
876
}
877
877
878
- /* Allocate space for a new refinfo and copy the objectname and flag to it */
879
- static struct refinfo * new_refinfo (const char * refname ,
880
- const unsigned char * objectname ,
881
- int flag )
878
+ /* Allocate space for a new ref_array_item and copy the objectname and flag to it */
879
+ static struct ref_array_item * new_ref_array_item (const char * refname ,
880
+ const unsigned char * objectname ,
881
+ int flag )
882
882
{
883
- struct refinfo * ref = xcalloc (1 , sizeof (struct refinfo ));
883
+ struct ref_array_item * ref = xcalloc (1 , sizeof (struct ref_array_item ));
884
884
ref -> refname = xstrdup (refname );
885
885
hashcpy (ref -> objectname , objectname );
886
886
ref -> flag = flag ;
@@ -896,7 +896,7 @@ static int grab_single_ref(const char *refname, const struct object_id *oid,
896
896
int flag , void * cb_data )
897
897
{
898
898
struct grab_ref_cbdata * cb = cb_data ;
899
- struct refinfo * ref ;
899
+ struct ref_array_item * ref ;
900
900
901
901
if (flag & REF_BAD_NAME ) {
902
902
warning ("ignoring ref with broken name %s" , refname );
@@ -911,14 +911,14 @@ static int grab_single_ref(const char *refname, const struct object_id *oid,
911
911
* to do its job and the resulting list may yet to be pruned
912
912
* by maxcount logic.
913
913
*/
914
- ref = new_refinfo (refname , oid -> hash , flag );
914
+ ref = new_ref_array_item (refname , oid -> hash , flag );
915
915
916
916
REALLOC_ARRAY (cb -> grab_array , cb -> grab_cnt + 1 );
917
917
cb -> grab_array [cb -> grab_cnt ++ ] = ref ;
918
918
return 0 ;
919
919
}
920
920
921
- static int cmp_ref_sort (struct ref_sort * s , struct refinfo * a , struct refinfo * b )
921
+ static int cmp_ref_sort (struct ref_sort * s , struct ref_array_item * a , struct ref_array_item * b )
922
922
{
923
923
struct atom_value * va , * vb ;
924
924
int cmp ;
@@ -945,8 +945,8 @@ static int cmp_ref_sort(struct ref_sort *s, struct refinfo *a, struct refinfo *b
945
945
static struct ref_sort * ref_sort ;
946
946
static int compare_refs (const void * a_ , const void * b_ )
947
947
{
948
- struct refinfo * a = * ((struct refinfo * * )a_ );
949
- struct refinfo * b = * ((struct refinfo * * )b_ );
948
+ struct ref_array_item * a = * ((struct ref_array_item * * )a_ );
949
+ struct ref_array_item * b = * ((struct ref_array_item * * )b_ );
950
950
struct ref_sort * s ;
951
951
952
952
for (s = ref_sort ; s ; s = s -> next ) {
@@ -957,10 +957,10 @@ static int compare_refs(const void *a_, const void *b_)
957
957
return 0 ;
958
958
}
959
959
960
- static void sort_refs (struct ref_sort * sort , struct refinfo * * refs , int num_refs )
960
+ static void sort_refs (struct ref_sort * sort , struct ref_array_item * * refs , int num_refs )
961
961
{
962
962
ref_sort = sort ;
963
- qsort (refs , num_refs , sizeof (struct refinfo * ), compare_refs );
963
+ qsort (refs , num_refs , sizeof (struct ref_array_item * ), compare_refs );
964
964
}
965
965
966
966
static void print_value (struct atom_value * v , int quote_style )
@@ -1027,7 +1027,7 @@ static void emit(const char *cp, const char *ep)
1027
1027
}
1028
1028
}
1029
1029
1030
- static void show_ref (struct refinfo * info , const char * format , int quote_style )
1030
+ static void show_ref (struct ref_array_item * info , const char * format , int quote_style )
1031
1031
{
1032
1032
const char * cp , * sp , * ep ;
1033
1033
@@ -1100,7 +1100,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
1100
1100
const char * format = "%(objectname) %(objecttype)\t%(refname)" ;
1101
1101
struct ref_sort * sort = NULL , * * sort_tail = & sort ;
1102
1102
int maxcount = 0 , quote_style = 0 ;
1103
- struct refinfo * * refs ;
1103
+ struct ref_array_item * * refs ;
1104
1104
struct grab_ref_cbdata cbdata ;
1105
1105
1106
1106
struct option opts [] = {
0 commit comments