Skip to content

Commit 726359b

Browse files
committed
Merge branch 'jk/rev-list-no-bitmap-while-pruning' into maint
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
2 parents aa0b816 + c8a70d3 commit 726359b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

builtin/rev-list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
355355
if (bisect_list)
356356
revs.limited = 1;
357357

358-
if (use_bitmap_index) {
358+
if (use_bitmap_index && !revs.prune) {
359359
if (revs.count && !revs.left_right && !revs.cherry_mark) {
360360
uint32_t commit_count;
361361
if (!prepare_bitmap_walk(&revs)) {

t/t5310-pack-bitmaps.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ rev_list_tests() {
5353
test_cmp expect actual
5454
'
5555

56+
test_expect_success "counting commits with limiting ($state)" '
57+
git rev-list --count HEAD -- 1.t >expect &&
58+
git rev-list --use-bitmap-index --count HEAD -- 1.t >actual &&
59+
test_cmp expect actual
60+
'
61+
5662
test_expect_success "enumerate --objects ($state)" '
5763
git rev-list --objects --use-bitmap-index HEAD >tmp &&
5864
cut -d" " -f1 <tmp >tmp2 &&

0 commit comments

Comments
 (0)