Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2020-12-09 01:04:17 +0300
committerJunio C Hamano <gitster@pobox.com>2020-12-09 01:48:17 +0300
commit1467b9572aa57c1369aaac897fcbbddde4080d75 (patch)
tree4d3bc1546d50c3899fb314a198c94aebbc459fec /t/t5310-pack-bitmaps.sh
parent597b2c39af9ee65496591448715588b711e91947 (diff)
t5310: add branch-based checks
The current rev-list tests that check the bitmap data only work on HEAD instead of multiple branches. Expand the test cases to handle both 'master' and 'other' branches. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5310-pack-bitmaps.sh')
-rwxr-xr-xt/t5310-pack-bitmaps.sh61
1 files changed, 34 insertions, 27 deletions
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index cdebcd79b6..1dd9723721 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -42,63 +42,70 @@ test_expect_success 'rev-list --test-bitmap verifies bitmaps' '
git rev-list --test-bitmap HEAD
'
-rev_list_tests() {
- state=$1
-
- test_expect_success "counting commits via bitmap ($state)" '
- git rev-list --count HEAD >expect &&
- git rev-list --use-bitmap-index --count HEAD >actual &&
+rev_list_tests_head () {
+ test_expect_success "counting commits via bitmap ($state, $branch)" '
+ git rev-list --count $branch >expect &&
+ git rev-list --use-bitmap-index --count $branch >actual &&
test_cmp expect actual
'
- test_expect_success "counting partial commits via bitmap ($state)" '
- git rev-list --count HEAD~5..HEAD >expect &&
- git rev-list --use-bitmap-index --count HEAD~5..HEAD >actual &&
+ test_expect_success "counting partial commits via bitmap ($state, $branch)" '
+ git rev-list --count $branch~5..$branch >expect &&
+ git rev-list --use-bitmap-index --count $branch~5..$branch >actual &&
test_cmp expect actual
'
- test_expect_success "counting commits with limit ($state)" '
- git rev-list --count -n 1 HEAD >expect &&
- git rev-list --use-bitmap-index --count -n 1 HEAD >actual &&
+ test_expect_success "counting commits with limit ($state, $branch)" '
+ git rev-list --count -n 1 $branch >expect &&
+ git rev-list --use-bitmap-index --count -n 1 $branch >actual &&
test_cmp expect actual
'
- test_expect_success "counting non-linear history ($state)" '
+ test_expect_success "counting non-linear history ($state, $branch)" '
git rev-list --count other...second >expect &&
git rev-list --use-bitmap-index --count other...second >actual &&
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_expect_success "counting commits with limiting ($state, $branch)" '
+ git rev-list --count $branch -- 1.t >expect &&
+ git rev-list --use-bitmap-index --count $branch -- 1.t >actual &&
test_cmp expect actual
'
- test_expect_success "counting objects via bitmap ($state)" '
- git rev-list --count --objects HEAD >expect &&
- git rev-list --use-bitmap-index --count --objects HEAD >actual &&
+ test_expect_success "counting objects via bitmap ($state, $branch)" '
+ git rev-list --count --objects $branch >expect &&
+ git rev-list --use-bitmap-index --count --objects $branch >actual &&
test_cmp expect actual
'
- test_expect_success "enumerate commits ($state)" '
- git rev-list --use-bitmap-index HEAD >actual &&
- git rev-list HEAD >expect &&
+ test_expect_success "enumerate commits ($state, $branch)" '
+ git rev-list --use-bitmap-index $branch >actual &&
+ git rev-list $branch >expect &&
test_bitmap_traversal --no-confirm-bitmaps expect actual
'
- test_expect_success "enumerate --objects ($state)" '
- git rev-list --objects --use-bitmap-index HEAD >actual &&
- git rev-list --objects HEAD >expect &&
+ test_expect_success "enumerate --objects ($state, $branch)" '
+ git rev-list --objects --use-bitmap-index $branch >actual &&
+ git rev-list --objects $branch >expect &&
test_bitmap_traversal expect actual
'
- test_expect_success "bitmap --objects handles non-commit objects ($state)" '
- git rev-list --objects --use-bitmap-index HEAD tagged-blob >actual &&
+ test_expect_success "bitmap --objects handles non-commit objects ($state, $branch)" '
+ git rev-list --objects --use-bitmap-index $branch tagged-blob >actual &&
grep $blob actual
'
}
+rev_list_tests () {
+ state=$1
+
+ for branch in "second" "other"
+ do
+ rev_list_tests_head
+ done
+}
+
rev_list_tests 'full bitmap'
test_expect_success 'clone from bitmapped repository' '