summaryrefslogtreecommitdiff
path: root/sha1-name.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-04-16 09:33:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-16 09:56:52 (GMT)
commit7f07c033a6ee1a0751e0b136aca1f37258106109 (patch)
treeab5e8899ed10724030e6d5100c02d00543cb6ac3 /sha1-name.c
parentfae2ae45df32192bb862f1d71704381d67ce81b3 (diff)
downloadgit-7f07c033a6ee1a0751e0b136aca1f37258106109.zip
git-7f07c033a6ee1a0751e0b136aca1f37258106109.tar.gz
git-7f07c033a6ee1a0751e0b136aca1f37258106109.tar.bz2
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>
Diffstat (limited to 'sha1-name.c')
-rw-r--r--sha1-name.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sha1-name.c b/sha1-name.c
index 7558ce5..b9381aa 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -514,6 +514,7 @@ struct min_abbrev_data {
unsigned int init_len;
unsigned int cur_len;
char *hex;
+ struct repository *repo;
const struct object_id *oid;
};
@@ -619,9 +620,9 @@ static void find_abbrev_len_packed(struct min_abbrev_data *mad)
struct multi_pack_index *m;
struct packed_git *p;
- for (m = get_multi_pack_index(the_repository); m; m = m->next)
+ for (m = get_multi_pack_index(mad->repo); m; m = m->next)
find_abbrev_len_for_midx(m, mad);
- for (p = get_packed_git(the_repository); p; p = p->next)
+ for (p = get_packed_git(mad->repo); p; p = p->next)
find_abbrev_len_for_pack(p, mad);
}
@@ -658,6 +659,7 @@ int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len)
if (len == hexsz || !len)
return hexsz;
+ mad.repo = the_repository;
mad.init_len = len;
mad.cur_len = len;
mad.hex = hex;