Skip to content

Commit

Permalink
Merge branch 'jk/rev-list-no-bitmap-while-pruning' into maint
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Jul 27, 2015
2 parents aa0b816 + c8a70d3 commit 726359b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
6 changes: 6 additions & 0 deletions t/t5310-pack-bitmaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 726359b

Please sign in to comment.