diff options
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r-- | pack-bitmap.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c index 1f69b5fa85..f2b59fbf48 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 @@ -630,6 +631,9 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git, traverse_commit_list_filtered(filter, revs, show_commit, show_object, &show_data, NULL); + + revs->include_check = NULL; + revs->include_check_data = NULL; } return base; @@ -978,7 +982,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs, /* try to open a bitmapped pack, but don't parse it yet * because we may not need to use it */ - bitmap_git = xcalloc(1, sizeof(*bitmap_git)); + CALLOC_ARRAY(bitmap_git, 1); if (open_pack_bitmap(revs->repo, bitmap_git) < 0) goto cleanup; @@ -997,6 +1001,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs, object_list_insert(object, &wants); object = parse_object_or_die(get_tagged_oid(tag), NULL); + object->flags |= (tag->object.flags & UNINTERESTING); } if (object->flags & UNINTERESTING) @@ -1350,6 +1355,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) @@ -1388,7 +1411,7 @@ uint32_t *create_bitmap_mapping(struct bitmap_index *bitmap_git, uint32_t *reposition; num_objects = bitmap_git->pack->num_objects; - reposition = xcalloc(num_objects, sizeof(uint32_t)); + CALLOC_ARRAY(reposition, num_objects); for (i = 0; i < num_objects; ++i) { struct object_id oid; @@ -1511,3 +1534,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"); +} |