@@ -626,15 +626,16 @@ static void find_abbrev_len_packed(struct min_abbrev_data *mad)
626
626
find_abbrev_len_for_pack (p , mad );
627
627
}
628
628
629
- int find_unique_abbrev_r (char * hex , const struct object_id * oid , int len )
629
+ int repo_find_unique_abbrev_r (struct repository * r , char * hex ,
630
+ const struct object_id * oid , int len )
630
631
{
631
632
struct disambiguate_state ds ;
632
633
struct min_abbrev_data mad ;
633
634
struct object_id oid_ret ;
634
- const unsigned hexsz = the_hash_algo -> hexsz ;
635
+ const unsigned hexsz = r -> hash_algo -> hexsz ;
635
636
636
637
if (len < 0 ) {
637
- unsigned long count = approximate_object_count ( );
638
+ unsigned long count = repo_approximate_object_count ( r );
638
639
/*
639
640
* Add one because the MSB only tells us the highest bit set,
640
641
* not including the value of all the _other_ bits (so "15"
@@ -659,7 +660,7 @@ int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len)
659
660
if (len == hexsz || !len )
660
661
return hexsz ;
661
662
662
- mad .repo = the_repository ;
663
+ mad .repo = r ;
663
664
mad .init_len = len ;
664
665
mad .cur_len = len ;
665
666
mad .hex = hex ;
@@ -681,13 +682,15 @@ int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len)
681
682
return mad .cur_len ;
682
683
}
683
684
684
- const char * find_unique_abbrev (const struct object_id * oid , int len )
685
+ const char * repo_find_unique_abbrev (struct repository * r ,
686
+ const struct object_id * oid ,
687
+ int len )
685
688
{
686
689
static int bufno ;
687
690
static char hexbuffer [4 ][GIT_MAX_HEXSZ + 1 ];
688
691
char * hex = hexbuffer [bufno ];
689
692
bufno = (bufno + 1 ) % ARRAY_SIZE (hexbuffer );
690
- find_unique_abbrev_r ( hex , oid , len );
693
+ repo_find_unique_abbrev_r ( r , hex , oid , len );
691
694
return hex ;
692
695
}
693
696
0 commit comments