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
This commit is contained in:
Junio C Hamano
2021-04-13 15:28:50 -07:00
9 changed files with 142 additions and 0 deletions

View File

@ -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");
}