]>
Commit | Line | Data |
---|---|---|
e03f928e JK |
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 && | |
84243da1 | 9 | test_commit much-larger-blob-one && |
e03f928e | 10 | git repack -adb && |
84243da1 JK |
11 | test_commit two && |
12 | test_commit much-larger-blob-two | |
e03f928e JK |
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 | ||
4f3bd560 JK |
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 | ||
84243da1 JK |
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 | ||
e03f928e | 56 | test_done |