3 test_description='apply to deeper directory without getting fooled with symlink'
6 test_expect_success setup '
8 mkdir -p arch/i386/boot arch/x86_64 &&
9 test_write_lines 1 2 3 4 5 >arch/i386/boot/Makefile &&
10 test_ln_s_add ../i386/boot arch/x86_64/boot &&
13 git commit -m initial &&
16 rm arch/x86_64/boot &&
17 mkdir arch/x86_64/boot &&
18 test_write_lines 2 3 4 5 6 >arch/x86_64/boot/Makefile &&
21 git commit -a -m second &&
23 git format-patch --binary -1 --stdout >test.patch
27 test_expect_success apply '
30 git diff --exit-code test &&
31 git diff --exit-code --cached test &&
32 git apply --index test.patch
36 test_expect_success 'check result' '
38 git diff --exit-code master &&
39 git diff --exit-code --cached master &&
41 git commit -m replay &&
42 T1=$(git rev-parse "master^{tree}") &&
43 T2=$(git rev-parse "HEAD^{tree}") &&