summaryrefslogtreecommitdiff
path: root/t/t5310-pack-bitmaps.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2015-07-01 14:42:17 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-07-01 12:00:50 -0700
commitc8a70d35090c490ce0e9f1354ef372b2887bea28 (patch)
treece7496ef602855265f6980c6556cecd2bf8f0607 /t/t5310-pack-bitmaps.sh
parentMerge branch 'maint-1.9' into maint-2.0 (diff)
downloadtgif-c8a70d35090c490ce0e9f1354ef372b2887bea28.tar.xz
rev-list: disable --use-bitmap-index when pruning commits
The reachability bitmaps do not have enough information to tell us which commits might have changed path "foo", so the current code produces wrong answers for: git rev-list --use-bitmap-index --count HEAD -- foo (it silently ignores the "foo" limiter). Instead, we should fall back to doing a normal traversal (it is OK to fall back rather than complain, because --use-bitmap-index is a pure optimization, and might not kick in for other reasons, such as there being no bitmaps in the repository). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5310-pack-bitmaps.sh')
-rwxr-xr-xt/t5310-pack-bitmaps.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index f4f02ba918..bbb7623e70 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 &&