sha1-name.c: remove the_repo from find_abbrev_len_packed()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Apr 16, 2019 at 16:33 UTC 7f07c033a6ee1a0751e0b136aca1f37258106109
1 file changed +4 -2
sha1-name.c
+4 -2
@@ -514,6 +514,7 @@ struct min_abbrev_data {
514 unsigned int init_len;
515 unsigned int cur_len;
516 char *hex;
517 + struct repository *repo;
518 const struct object_id *oid;
519 };
520
@@ -619,9 +620,9 @@ static void find_abbrev_len_packed(struct min_abbrev_data *mad)
620 struct multi_pack_index *m;
621 struct packed_git *p;
622
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)
624 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)
626 find_abbrev_len_for_pack(p, mad);
627 }
628
@@ -658,6 +659,7 @@ int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len)
659 if (len == hexsz || !len)
660 return hexsz;
661
662 + mad.repo = the_repository;
663 mad.init_len = len;
664 mad.cur_len = len;
665 mad.hex = hex;