]>
Commit | Line | Data |
---|---|---|
c9a42c4a JS |
1 | #!/bin/sh |
2 | ||
3 | test_description='some bundle related tests' | |
4 | . ./test-lib.sh | |
5 | ||
6 | test_expect_success 'setup' ' | |
8a557bb7 | 7 | test_commit initial && |
c9a42c4a JS |
8 | test_tick && |
9 | git tag -m tag tag && | |
8a557bb7 TR |
10 | test_commit second && |
11 | test_commit third && | |
12 | git tag -d initial && | |
13 | git tag -d second && | |
14 | git tag -d third | |
c9a42c4a JS |
15 | ' |
16 | ||
17 | test_expect_success 'tags can be excluded by rev-list options' ' | |
c9a42c4a JS |
18 | git bundle create bundle --all --since=7.Apr.2005.15:16:00.-0700 && |
19 | git ls-remote bundle > output && | |
20 | ! grep tag output | |
c9a42c4a JS |
21 | ' |
22 | ||
0f5cdf65 | 23 | test_expect_success 'die if bundle file cannot be created' ' |
0f5cdf65 CH |
24 | mkdir adir && |
25 | test_must_fail git bundle create adir --all | |
0f5cdf65 CH |
26 | ' |
27 | ||
f62e0a39 | 28 | test_expect_failure 'bundle --stdin' ' |
f62e0a39 JN |
29 | echo master | git bundle create stdin-bundle.bdl --stdin && |
30 | git ls-remote stdin-bundle.bdl >output && | |
31 | grep master output | |
f62e0a39 JN |
32 | ' |
33 | ||
34 | test_expect_failure 'bundle --stdin <rev-list options>' ' | |
f62e0a39 JN |
35 | echo master | git bundle create hybrid-bundle.bdl --stdin tag && |
36 | git ls-remote hybrid-bundle.bdl >output && | |
37 | grep master output | |
f62e0a39 JN |
38 | ' |
39 | ||
54440e15 | 40 | test_expect_success 'empty bundle file is rejected' ' |
8a557bb7 TR |
41 | : >empty-bundle && |
42 | test_must_fail git fetch empty-bundle | |
54440e15 BH |
43 | ' |
44 | ||
bc2fed49 TR |
45 | # This triggers a bug in older versions where the resulting line (with |
46 | # --pretty=oneline) was longer than a 1024-char buffer. | |
47 | test_expect_success 'ridiculously long subject in boundary' ' | |
48 | : >file4 && | |
49 | test_tick && | |
50 | git add file4 && | |
51 | printf "%01200d\n" 0 | git commit -F - && | |
52 | test_commit fifth && | |
53 | git bundle create long-subject-bundle.bdl HEAD^..HEAD && | |
54 | git bundle list-heads long-subject-bundle.bdl >heads && | |
55 | test -s heads && | |
56 | git fetch long-subject-bundle.bdl && | |
0dbe6592 TR |
57 | sed -n "/^-/{p;q;}" long-subject-bundle.bdl >boundary && |
58 | grep "^-[0-9a-f]\\{40\\} " boundary | |
bc2fed49 TR |
59 | ' |
60 | ||
5446e33f LF |
61 | test_expect_success 'prerequisites with an empty commit message' ' |
62 | : >file1 && | |
63 | git add file1 && | |
64 | test_tick && | |
65 | git commit --allow-empty-message -m "" && | |
66 | test_commit file2 && | |
67 | git bundle create bundle HEAD^.. && | |
68 | git bundle verify bundle | |
69 | ' | |
70 | ||
c9a42c4a | 71 | test_done |