Merge branch 'jm/gitweb-fastcgi-utf8'
[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_done