| test_description='apply to deeper directory without getting fooled with symlink' |
| test_expect_success setup ' |
| mkdir -p arch/i386/boot arch/x86_64 && |
| lecho 1 2 3 4 5 >arch/i386/boot/Makefile && |
| ln -s ../i386/boot arch/x86_64/boot && |
| mkdir arch/x86_64/boot && |
| lecho 2 3 4 5 6 >arch/x86_64/boot/Makefile && |
| git commit -a -m second && |
| git format-patch --binary -1 --stdout >test.patch |
| test_expect_success apply ' |
| git diff --exit-code test && |
| git diff --exit-code --cached test && |
| git apply --index test.patch |
| test_expect_success 'check result' ' |
| git diff --exit-code master && |
| git diff --exit-code --cached master && |
| T1=$(git rev-parse "master^{tree}") && |
| T2=$(git rev-parse "HEAD^{tree}") && |