diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-11-10 06:49:08 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-12 14:50:06 +0900 |
commit | 7c14112741b81366cfbbc3b98e0b92422fcce83d (patch) | |
tree | 25ea81f5000e4f9cdf5b80b39c00a1021c917188 /pack-bitmap.c | |
parent | 94e10825bd72660548956a6d5fb260642ffb6386 (diff) | |
download | git-7c14112741b81366cfbbc3b98e0b92422fcce83d.tar.gz |
pack-*.c: remove the_repository references
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 'pack-bitmap.c')
-rw-r--r-- | pack-bitmap.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c index 5848cc93aa..4695aaf6b4 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -328,14 +328,15 @@ failed: return -1; } -static int open_pack_bitmap(struct bitmap_index *bitmap_git) +static int open_pack_bitmap(struct repository *r, + struct bitmap_index *bitmap_git) { struct packed_git *p; int ret = -1; assert(!bitmap_git->map); - for (p = get_all_packs(the_repository); p; p = p->next) { + for (p = get_all_packs(r); p; p = p->next) { if (open_pack_bitmap_1(bitmap_git, p) == 0) ret = 0; } @@ -343,11 +344,11 @@ static int open_pack_bitmap(struct bitmap_index *bitmap_git) return ret; } -struct bitmap_index *prepare_bitmap_git(void) +struct bitmap_index *prepare_bitmap_git(struct repository *r) { struct bitmap_index *bitmap_git = xcalloc(1, sizeof(*bitmap_git)); - if (!open_pack_bitmap(bitmap_git) && !load_pack_bitmap(bitmap_git)) + if (!open_pack_bitmap(r, bitmap_git) && !load_pack_bitmap(bitmap_git)) return bitmap_git; free_bitmap_index(bitmap_git); @@ -690,7 +691,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs) struct bitmap_index *bitmap_git = xcalloc(1, sizeof(*bitmap_git)); /* try to open a bitmapped pack, but don't parse it yet * because we may not need to use it */ - if (open_pack_bitmap(bitmap_git) < 0) + if (open_pack_bitmap(revs->repo, bitmap_git) < 0) goto cleanup; for (i = 0; i < revs->pending.nr; ++i) { @@ -955,7 +956,7 @@ void test_bitmap_walk(struct rev_info *revs) struct bitmap_test_data tdata; struct bitmap_index *bitmap_git; - if (!(bitmap_git = prepare_bitmap_git())) + if (!(bitmap_git = prepare_bitmap_git(revs->repo))) die("failed to load bitmap indexes"); if (revs->pending.nr != 1) |