Skip to content

Commit 1467b95

Browse files
derrickstoleegitster
authored andcommitted
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 <[email protected]> Helped-by: Junio C Hamano <[email protected]> Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 597b2c3 commit 1467b95

File tree

1 file changed

+34
-27
lines changed

1 file changed

+34
-27
lines changed

t/t5310-pack-bitmaps.sh

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,63 +42,70 @@ test_expect_success 'rev-list --test-bitmap verifies bitmaps' '
4242
git rev-list --test-bitmap HEAD
4343
'
4444

45-
rev_list_tests() {
46-
state=$1
47-
48-
test_expect_success "counting commits via bitmap ($state)" '
49-
git rev-list --count HEAD >expect &&
50-
git rev-list --use-bitmap-index --count HEAD >actual &&
45+
rev_list_tests_head () {
46+
test_expect_success "counting commits via bitmap ($state, $branch)" '
47+
git rev-list --count $branch >expect &&
48+
git rev-list --use-bitmap-index --count $branch >actual &&
5149
test_cmp expect actual
5250
'
5351

54-
test_expect_success "counting partial commits via bitmap ($state)" '
55-
git rev-list --count HEAD~5..HEAD >expect &&
56-
git rev-list --use-bitmap-index --count HEAD~5..HEAD >actual &&
52+
test_expect_success "counting partial commits via bitmap ($state, $branch)" '
53+
git rev-list --count $branch~5..$branch >expect &&
54+
git rev-list --use-bitmap-index --count $branch~5..$branch >actual &&
5755
test_cmp expect actual
5856
'
5957

60-
test_expect_success "counting commits with limit ($state)" '
61-
git rev-list --count -n 1 HEAD >expect &&
62-
git rev-list --use-bitmap-index --count -n 1 HEAD >actual &&
58+
test_expect_success "counting commits with limit ($state, $branch)" '
59+
git rev-list --count -n 1 $branch >expect &&
60+
git rev-list --use-bitmap-index --count -n 1 $branch >actual &&
6361
test_cmp expect actual
6462
'
6563

66-
test_expect_success "counting non-linear history ($state)" '
64+
test_expect_success "counting non-linear history ($state, $branch)" '
6765
git rev-list --count other...second >expect &&
6866
git rev-list --use-bitmap-index --count other...second >actual &&
6967
test_cmp expect actual
7068
'
7169

72-
test_expect_success "counting commits with limiting ($state)" '
73-
git rev-list --count HEAD -- 1.t >expect &&
74-
git rev-list --use-bitmap-index --count HEAD -- 1.t >actual &&
70+
test_expect_success "counting commits with limiting ($state, $branch)" '
71+
git rev-list --count $branch -- 1.t >expect &&
72+
git rev-list --use-bitmap-index --count $branch -- 1.t >actual &&
7573
test_cmp expect actual
7674
'
7775

78-
test_expect_success "counting objects via bitmap ($state)" '
79-
git rev-list --count --objects HEAD >expect &&
80-
git rev-list --use-bitmap-index --count --objects HEAD >actual &&
76+
test_expect_success "counting objects via bitmap ($state, $branch)" '
77+
git rev-list --count --objects $branch >expect &&
78+
git rev-list --use-bitmap-index --count --objects $branch >actual &&
8179
test_cmp expect actual
8280
'
8381

84-
test_expect_success "enumerate commits ($state)" '
85-
git rev-list --use-bitmap-index HEAD >actual &&
86-
git rev-list HEAD >expect &&
82+
test_expect_success "enumerate commits ($state, $branch)" '
83+
git rev-list --use-bitmap-index $branch >actual &&
84+
git rev-list $branch >expect &&
8785
test_bitmap_traversal --no-confirm-bitmaps expect actual
8886
'
8987

90-
test_expect_success "enumerate --objects ($state)" '
91-
git rev-list --objects --use-bitmap-index HEAD >actual &&
92-
git rev-list --objects HEAD >expect &&
88+
test_expect_success "enumerate --objects ($state, $branch)" '
89+
git rev-list --objects --use-bitmap-index $branch >actual &&
90+
git rev-list --objects $branch >expect &&
9391
test_bitmap_traversal expect actual
9492
'
9593

96-
test_expect_success "bitmap --objects handles non-commit objects ($state)" '
97-
git rev-list --objects --use-bitmap-index HEAD tagged-blob >actual &&
94+
test_expect_success "bitmap --objects handles non-commit objects ($state, $branch)" '
95+
git rev-list --objects --use-bitmap-index $branch tagged-blob >actual &&
9896
grep $blob actual
9997
'
10098
}
10199

100+
rev_list_tests () {
101+
state=$1
102+
103+
for branch in "second" "other"
104+
do
105+
rev_list_tests_head
106+
done
107+
}
108+
102109
rev_list_tests 'full bitmap'
103110

104111
test_expect_success 'clone from bitmapped repository' '

0 commit comments

Comments
 (0)