The seventh batch
[git/debian.git] / t / t4121-apply-diffs.sh
bloba80cec9d1193be70416eb46257d5ba6fcea30952
1 #!/bin/sh
3 test_description='git apply for contextually independent diffs'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7 TEST_PASSES_SANITIZE_LEAK=true
8 . ./test-lib.sh
10 echo '1
17 8' >file
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 &&
30 git checkout main'
32 test_expect_success \
33 'check if contextually independent diffs for the same file apply' \
34 '( git diff test~2 test~1 && git diff test~1 test~0 )| git apply'
36 test_done