Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 bcd059ccd9..1eb9615df8 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -333,6 +333,7 @@ void bitmap_writer_build(struct packing_data *to_pack)
struct commit *commit = bb.commits[i-1];
struct bb_commit *ent = bb_data_at(&bb.data, commit);
struct commit *child;
+ int reused = 0;
fill_bitmap_commit(ent, commit);
@@ -348,10 +349,15 @@ void bitmap_writer_build(struct packing_data *to_pack)
if (child_ent->bitmap)
bitmap_or(child_ent->bitmap, ent->bitmap);
- else
+ else if (reused)
child_ent->bitmap = bitmap_dup(ent->bitmap);
+ else {
+ child_ent->bitmap = ent->bitmap;
+ reused = 1;
+ }
}
- bitmap_free(ent->bitmap);
+ if (!reused)
+ bitmap_free(ent->bitmap);
ent->bitmap = NULL;
}
bitmap_builder_clear(&bb);