diff options
author | Graydon, Tracy <tracy.graydon@intel.com> | 2013-01-31 17:08:15 -0800 |
---|---|---|
committer | Graydon, Tracy <tracy.graydon@intel.com> | 2013-01-31 17:08:15 -0800 |
commit | 699fc9f67a9a62df492d1cd049e4978953640de9 (patch) | |
tree | f0c16f1494bd71922e7bf5258037427cac4a350b /t/t4122-apply-symlink-inside.sh | |
download | git-2.0alpha.tar.gz git-2.0alpha.tar.bz2 git-2.0alpha.zip |
Initial commit for TizenHEADsubmit/2.0alpha/20130201.014617accepted/2.0alpha/20130201.0121062.0alpha
Diffstat (limited to 't/t4122-apply-symlink-inside.sh')
-rwxr-xr-x | t/t4122-apply-symlink-inside.sh | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh new file mode 100755 index 0000000..923fcab --- /dev/null +++ b/t/t4122-apply-symlink-inside.sh @@ -0,0 +1,61 @@ +#!/bin/sh + +test_description='apply to deeper directory without getting fooled with symlink' +. ./test-lib.sh + +if ! test_have_prereq SYMLINKS +then + skip_all='Symbolic links not supported, skipping tests.' + test_done +fi + +lecho () { + for l_ + do + echo "$l_" + done +} + +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 && + git add . && + test_tick && + git commit -m initial && + git branch test && + + rm arch/x86_64/boot && + mkdir arch/x86_64/boot && + lecho 2 3 4 5 6 >arch/x86_64/boot/Makefile && + git add . && + test_tick && + git commit -a -m second && + + git format-patch --binary -1 --stdout >test.patch + +' + +test_expect_success apply ' + + git checkout test && + 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 && + test_tick && + git commit -m replay && + T1=$(git rev-parse "master^{tree}") && + T2=$(git rev-parse "HEAD^{tree}") && + test "z$T1" = "z$T2" + +' + +test_done |