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:
authorJunio C Hamano <gitster@pobox.com>2018-07-18 22:20:30 +0300
committerJunio C Hamano <gitster@pobox.com>2018-07-18 22:20:30 +0300
commitad7b8a7c5af3d47b746c9347baca8d4521c9633d (patch)
tree2e0fd93a40591429ed025521e77bb7266666da8e /builtin/rev-list.c
parenta4d4427bc6c9acefe7803d204b4bdca3cd4059a0 (diff)
parentf3c23db2d7e764b247f7d76a8d0ba180811e9525 (diff)
Merge branch 'jt/remove-pack-bitmap-global'
The effort to move globals to per-repository in-core structure continues. * jt/remove-pack-bitmap-global: pack-bitmap: add free function pack-bitmap: remove bitmap_git global variable
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r--builtin/rev-list.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index e9bd4e378a..6fcb0ff6d5 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -17,6 +17,7 @@
#include "reflog-walk.h"
#include "oidset.h"
#include "packfile.h"
+#include "object-store.h"
static const char rev_list_usage[] =
"git rev-list [OPTION] <commit-id>... [ -- paths... ]\n"
@@ -515,17 +516,21 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
if (revs.count && !revs.left_right && !revs.cherry_mark) {
uint32_t commit_count;
int max_count = revs.max_count;
- if (!prepare_bitmap_walk(&revs)) {
- count_bitmap_commit_list(&commit_count, NULL, NULL, NULL);
+ struct bitmap_index *bitmap_git;
+ if ((bitmap_git = prepare_bitmap_walk(&revs))) {
+ count_bitmap_commit_list(bitmap_git, &commit_count, NULL, NULL, NULL);
if (max_count >= 0 && max_count < commit_count)
commit_count = max_count;
printf("%d\n", commit_count);
+ free_bitmap_index(bitmap_git);
return 0;
}
} else if (revs.max_count < 0 &&
revs.tag_objects && revs.tree_objects && revs.blob_objects) {
- if (!prepare_bitmap_walk(&revs)) {
- traverse_bitmap_commit_list(&show_object_fast);
+ struct bitmap_index *bitmap_git;
+ if ((bitmap_git = prepare_bitmap_walk(&revs))) {
+ traverse_bitmap_commit_list(bitmap_git, &show_object_fast);
+ free_bitmap_index(bitmap_git);
return 0;
}
}