summaryrefslogtreecommitdiff
path: root/pack-bitmap.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-04-13 22:28:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-13 22:28:50 (GMT)
commit0623669fc6ddc6dc1ad706f135826f9a0910dd4b (patch)
tree79ba87fbe7d0f045f7acb616ab7086ae1562d38d /pack-bitmap.c
parentf63add4aa8e8c2ea413fe2bf3b5c9b0f55617e8b (diff)
parent3f267a112820f3bdf6b82362680ea6339f0e5f86 (diff)
downloadgit-0623669fc6ddc6dc1ad706f135826f9a0910dd4b.zip
git-0623669fc6ddc6dc1ad706f135826f9a0910dd4b.tar.gz
git-0623669fc6ddc6dc1ad706f135826f9a0910dd4b.tar.bz2
Merge branch 'tb/pack-preferred-tips-to-give-bitmap'
A configuration variable has been added to force tips of certain refs to be given a reachability bitmap. * tb/pack-preferred-tips-to-give-bitmap: builtin/pack-objects.c: respect 'pack.preferBitmapTips' t/helper/test-bitmap.c: initial commit pack-bitmap: add 'test_bitmap_commits()' helper
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r--pack-bitmap.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index b4513f8..3ed1543 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -13,6 +13,7 @@
#include "repository.h"
#include "object-store.h"
#include "list-objects-filter-options.h"
+#include "config.h"
/*
* An entry on the bitmap index, representing the bitmap for a given
@@ -1351,6 +1352,24 @@ void test_bitmap_walk(struct rev_info *revs)
free_bitmap_index(bitmap_git);
}
+int test_bitmap_commits(struct repository *r)
+{
+ struct bitmap_index *bitmap_git = prepare_bitmap_git(r);
+ struct object_id oid;
+ MAYBE_UNUSED void *value;
+
+ if (!bitmap_git)
+ die("failed to load bitmap indexes");
+
+ kh_foreach(bitmap_git->bitmaps, oid, value, {
+ printf("%s\n", oid_to_hex(&oid));
+ });
+
+ free_bitmap_index(bitmap_git);
+
+ return 0;
+}
+
int rebuild_bitmap(const uint32_t *reposition,
struct ewah_bitmap *source,
struct bitmap *dest)
@@ -1512,3 +1531,8 @@ off_t get_disk_usage_from_bitmap(struct bitmap_index *bitmap_git,
return total;
}
+
+const struct string_list *bitmap_preferred_tips(struct repository *r)
+{
+ return repo_config_get_value_multi(r, "pack.preferbitmaptips");
+}