Merge branch 'jk/rev-list-no-bitmap-while-pruning'
authorJunio C Hamano <gitster@pobox.com>
Fri, 10 Jul 2015 21:26:12 +0000 (14:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jul 2015 21:26:12 +0000 (14:26 -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

1  2 
t/t5310-pack-bitmaps.sh
diff --combined t/t5310-pack-bitmaps.sh
index 6003490192880802d866ec3788facaf4dcf17147,bbb7623e70463572d1041ca0e016952fb227a296..d446706e94fb878b471e6deaebba4ec7abc76930
@@@ -18,7 -18,7 +18,7 @@@ test_expect_success 'setup repo with mo
        git checkout master &&
        blob=$(echo tagged-blob | git hash-object -w --stdin) &&
        git tag tagged-blob $blob &&
 -      git config pack.writebitmaps true &&
 +      git config repack.writebitmaps true &&
        git config pack.writebitmaphashcache true
  '
  
@@@ -53,6 -53,12 +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 &&
@@@ -170,13 -176,4 +176,13 @@@ test_expect_success JGIT 'jgit can rea
        )
  '
  
 +test_expect_success 'splitting packs does not generate bogus bitmaps' '
 +      test-genrandom foo $((1024 * 1024)) >rand &&
 +      git add rand &&
 +      git commit -m "commit with big file" &&
 +      git -c pack.packSizeLimit=500k repack -adb &&
 +      git init --bare no-bitmaps.git &&
 +      git -C no-bitmaps.git fetch .. HEAD
 +'
 +
  test_done