summaryrefslogtreecommitdiff
path: root/pack-bitmap-write.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-07-18 12:20:30 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-07-18 12:20:30 -0700
commitad7b8a7c5af3d47b746c9347baca8d4521c9633d (patch)
tree2e0fd93a40591429ed025521e77bb7266666da8e /pack-bitmap-write.c
parentMerge branch 'bw/config-refer-to-gitsubmodules-doc' (diff)
parentpack-bitmap: add free function (diff)
downloadtgif-ad7b8a7c5af3d47b746c9347baca8d4521c9633d.tar.xz
Merge branch 'jt/remove-pack-bitmap-global'
The effort to move globals to per-repository in-core structure continues. * jt/remove-pack-bitmap-global: pack-bitmap: add free function pack-bitmap: remove bitmap_git global variable
Diffstat (limited to 'pack-bitmap-write.c')
-rw-r--r--pack-bitmap-write.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index 953c5dd84d..d977e9bacb 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -361,11 +361,17 @@ static int date_compare(const void *_a, const void *_b)
void bitmap_writer_reuse_bitmaps(struct packing_data *to_pack)
{
- if (prepare_bitmap_git() < 0)
+ struct bitmap_index *bitmap_git;
+ if (!(bitmap_git = prepare_bitmap_git()))
return;
writer.reused = kh_init_sha1();
- rebuild_existing_bitmaps(to_pack, writer.reused, writer.show_progress);
+ rebuild_existing_bitmaps(bitmap_git, to_pack, writer.reused,
+ writer.show_progress);
+ /*
+ * NEEDSWORK: rebuild_existing_bitmaps() makes writer.reused reference
+ * some bitmaps in bitmap_git, so we can't free the latter.
+ */
}
static struct ewah_bitmap *find_reused_bitmap(const unsigned char *sha1)