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:
authorJeff King <peff@peff.net>2019-12-18 14:25:39 +0300
committerJunio C Hamano <gitster@pobox.com>2020-01-23 21:51:50 +0300
commit40d18ff8c6b6977eaf8450dc4eeb866ece5298fc (patch)
tree9beea48f7024ff26c727872764a47ab144a14a2b /pack-bitmap.c
parent14fbd260442b14813e142f762050313daee1f18d (diff)
pack-bitmap: introduce bitmap_walk_contains()
We will use this helper function in a following commit to tell us if an object is packed. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r--pack-bitmap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index ed2befaac6..8891797c00 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -832,6 +832,18 @@ int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
return 0;
}
+int bitmap_walk_contains(struct bitmap_index *bitmap_git,
+ struct bitmap *bitmap, const struct object_id *oid)
+{
+ int idx;
+
+ if (!bitmap)
+ return 0;
+
+ idx = bitmap_position(bitmap_git, oid);
+ return idx >= 0 && bitmap_get(bitmap, idx);
+}
+
void traverse_bitmap_commit_list(struct bitmap_index *bitmap_git,
show_reachable_fn show_reachable)
{