Skip to content

Commit 7f07c03

Browse files
pcloudsgitster
authored andcommitted
sha1-name.c: remove the_repo from find_abbrev_len_packed()
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fae2ae4 commit 7f07c03

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sha1-name.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ struct min_abbrev_data {
514514
unsigned int init_len;
515515
unsigned int cur_len;
516516
char *hex;
517+
struct repository *repo;
517518
const struct object_id *oid;
518519
};
519520

@@ -619,9 +620,9 @@ static void find_abbrev_len_packed(struct min_abbrev_data *mad)
619620
struct multi_pack_index *m;
620621
struct packed_git *p;
621622

622-
for (m = get_multi_pack_index(the_repository); m; m = m->next)
623+
for (m = get_multi_pack_index(mad->repo); m; m = m->next)
623624
find_abbrev_len_for_midx(m, mad);
624-
for (p = get_packed_git(the_repository); p; p = p->next)
625+
for (p = get_packed_git(mad->repo); p; p = p->next)
625626
find_abbrev_len_for_pack(p, mad);
626627
}
627628

@@ -658,6 +659,7 @@ int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len)
658659
if (len == hexsz || !len)
659660
return hexsz;
660661

662+
mad.repo = the_repository;
661663
mad.init_len = len;
662664
mad.cur_len = len;
663665
mad.hex = hex;

0 commit comments

Comments
 (0)