diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-07-10 14:26:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-07-10 14:26:12 -0700 |
commit | ace6325ddf40725b07591d33dc06f3b82dba57ab (patch) | |
tree | 95a7304d0505ead1de5e8ada37a77f70a901e63e | |
parent | 3cbb92054b2b9cafbf2a662f7858e5896d3e7ac4 (diff) | |
parent | c8a70d35090c490ce0e9f1354ef372b2887bea28 (diff) | |
download | git-ace6325ddf40725b07591d33dc06f3b82dba57ab.tar.gz git-ace6325ddf40725b07591d33dc06f3b82dba57ab.tar.xz |
Merge branch 'jk/rev-list-no-bitmap-while-pruning'
A minor bugfix when pack bitmap is used with "rev-list --count".
* jk/rev-list-no-bitmap-while-pruning:
rev-list: disable --use-bitmap-index when pruning commits
-rw-r--r-- | builtin/rev-list.c | 2 | ||||
-rwxr-xr-x | t/t5310-pack-bitmaps.sh | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c index ff84a825f..88eddbd53 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -355,7 +355,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) if (bisect_list) revs.limited = 1; - if (use_bitmap_index) { + if (use_bitmap_index && !revs.prune) { if (revs.count && !revs.left_right && !revs.cherry_mark) { uint32_t commit_count; if (!prepare_bitmap_walk(&revs)) { diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh index 600349019..d446706e9 100755 --- a/t/t5310-pack-bitmaps.sh +++ b/t/t5310-pack-bitmaps.sh @@ -53,6 +53,12 @@ rev_list_tests() { test_cmp expect actual ' + test_expect_success "counting commits with limiting ($state)" ' + git rev-list --count HEAD -- 1.t >expect && + git rev-list --use-bitmap-index --count HEAD -- 1.t >actual && + test_cmp expect actual + ' + test_expect_success "enumerate --objects ($state)" ' git rev-list --objects --use-bitmap-index HEAD >tmp && cut -d" " -f1 <tmp >tmp2 && |