From 7c14112741b81366cfbbc3b98e0b92422fcce83d Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Sat, 10 Nov 2018 06:49:08 +0100 Subject: pack-*.c: remove the_repository references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- pack-bitmap.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'pack-bitmap.c') diff --git a/pack-bitmap.c b/pack-bitmap.c index 5848cc93a..4695aaf6b 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) -- cgit v1.2.3