]>
Commit | Line | Data |
---|---|---|
0afa7644 AR |
1 | #!/bin/sh |
2 | ||
5be60078 | 3 | test_description='git apply for contextually independent diffs' |
8f37854b | 4 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
334afbc7 JS |
5 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
6 | ||
9081a421 | 7 | TEST_PASSES_SANITIZE_LEAK=true |
0afa7644 AR |
8 | . ./test-lib.sh |
9 | ||
10 | echo '1 | |
11 | 2 | |
12 | 3 | |
13 | 4 | |
14 | 5 | |
15 | 6 | |
16 | 7 | |
17 | 8' >file | |
18 | ||
19 | test_expect_success 'setup' \ | |
20 | 'git add file && | |
21 | git commit -q -m 1 && | |
22 | git checkout -b test && | |
23 | mv file file.tmp && | |
24 | echo 0 >file && | |
25 | cat file.tmp >>file && | |
26 | rm file.tmp && | |
27 | git commit -a -q -m 2 && | |
28 | echo 9 >>file && | |
29 | git commit -a -q -m 3 && | |
8f37854b | 30 | git checkout main' |
0afa7644 AR |
31 | |
32 | test_expect_success \ | |
33 | 'check if contextually independent diffs for the same file apply' \ | |
f957f03b | 34 | '( git diff test~2 test~1 && git diff test~1 test~0 )| git apply' |
0afa7644 AR |
35 | |
36 | test_done |