]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6113-rev-list-bitmap-filters.sh
Merge branch 'en/ort-perf-batch-9'
[thirdparty/git.git] / t / t6113-rev-list-bitmap-filters.sh
CommitLineData
e03f928e
JK
1#!/bin/sh
2
3test_description='rev-list combining bitmaps and filters'
4. ./test-lib.sh
ddfe9006 5. "$TEST_DIRECTORY"/lib-bitmap.sh
e03f928e
JK
6
7test_expect_success 'set up bitmapped repo' '
8 # one commit will have bitmaps, the other will not
9 test_commit one &&
84243da1 10 test_commit much-larger-blob-one &&
e03f928e 11 git repack -adb &&
84243da1
JK
12 test_commit two &&
13 test_commit much-larger-blob-two
e03f928e
JK
14'
15
16test_expect_success 'filters fallback to non-bitmap traversal' '
17 # use a path-based filter, since they are inherently incompatible with
18 # bitmaps (i.e., this test will never get confused by later code to
19 # combine the features)
20 filter=$(echo "!one" | git hash-object -w --stdin) &&
21 git rev-list --objects --filter=sparse:oid=$filter HEAD >expect &&
22 git rev-list --use-bitmap-index \
23 --objects --filter=sparse:oid=$filter HEAD >actual &&
24 test_cmp expect actual
25'
26
4f3bd560
JK
27test_expect_success 'blob:none filter' '
28 git rev-list --objects --filter=blob:none HEAD >expect &&
29 git rev-list --use-bitmap-index \
30 --objects --filter=blob:none HEAD >actual &&
31 test_bitmap_traversal expect actual
32'
33
34test_expect_success 'blob:none filter with specified blob' '
35 git rev-list --objects --filter=blob:none HEAD HEAD:two.t >expect &&
36 git rev-list --use-bitmap-index \
37 --objects --filter=blob:none HEAD HEAD:two.t >actual &&
38 test_bitmap_traversal expect actual
39'
40
84243da1
JK
41test_expect_success 'blob:limit filter' '
42 git rev-list --objects --filter=blob:limit=5 HEAD >expect &&
43 git rev-list --use-bitmap-index \
44 --objects --filter=blob:limit=5 HEAD >actual &&
45 test_bitmap_traversal expect actual
46'
47
48test_expect_success 'blob:limit filter with specified blob' '
49 git rev-list --objects --filter=blob:limit=5 \
50 HEAD HEAD:much-larger-blob-two.t >expect &&
51 git rev-list --use-bitmap-index \
52 --objects --filter=blob:limit=5 \
53 HEAD HEAD:much-larger-blob-two.t >actual &&
54 test_bitmap_traversal expect actual
55'
56
b0a8d482
TB
57test_expect_success 'tree:0 filter' '
58 git rev-list --objects --filter=tree:0 HEAD >expect &&
59 git rev-list --use-bitmap-index \
60 --objects --filter=tree:0 HEAD >actual &&
61 test_bitmap_traversal expect actual
62'
63
64test_expect_success 'tree:0 filter with specified blob, tree' '
65 git rev-list --objects --filter=tree:0 HEAD HEAD:two.t >expect &&
66 git rev-list --use-bitmap-index \
67 --objects --filter=tree:0 HEAD HEAD:two.t >actual &&
68 test_bitmap_traversal expect actual
69'
70
71test_expect_success 'tree:1 filter' '
72 git rev-list --objects --filter=tree:1 HEAD >expect &&
73 git rev-list --use-bitmap-index \
74 --objects --filter=tree:1 HEAD >actual &&
75 test_cmp expect actual
76'
77
e03f928e 78test_done