]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4121-apply-diffs.sh
The sixth batch
[thirdparty/git.git] / t / t4121-apply-diffs.sh
CommitLineData
0afa7644
AR
1#!/bin/sh
2
5be60078 3test_description='git apply for contextually independent diffs'
8f37854b 4GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
334afbc7
JS
5export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
9081a421 7TEST_PASSES_SANITIZE_LEAK=true
0afa7644
AR
8. ./test-lib.sh
9
10echo '1
112
123
134
145
156
167
178' >file
18
19test_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
32test_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
36test_done