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