Merge branch 'jk/rev-list-no-bitmap-while-pruning' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Jul 2015 19:21:42 +0000 (12:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Jul 2015 19:21:42 +0000 (12:21 -0700)
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

builtin/rev-list.c
t/t5310-pack-bitmaps.sh

index ff84a82..88eddbd 100644 (file)
@@ -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)) {
index 6003490..d446706 100755 (executable)
@@ -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 &&