X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4102-apply-rename.sh;h=d42abff1ad59343fa1c84bded9a82c3212370da0;hb=a79b8b6623288f7d5409ad749cc6553976a4f0e8;hp=fbb508d389e078263d983bf6736df8f1a0fe7b5d;hpb=0a8f4f0020cb35095005852c0797f0b90e9ebb74;p=git.git diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh index fbb508d38..d42abff1a 100755 --- a/t/t4102-apply-rename.sh +++ b/t/t4102-apply-rename.sh @@ -3,7 +3,7 @@ # Copyright (c) 2005 Junio C Hamano # -test_description='git-apply handling copy/rename patch. +test_description='git apply handling copy/rename patch. ' . ./test-lib.sh @@ -13,8 +13,8 @@ test_description='git-apply handling copy/rename patch. cat >test-patch <<\EOF diff --git a/foo b/bar similarity index 47% -copy from foo -copy to bar +rename from foo +rename to bar --- a/foo +++ b/bar @@ -1 +1 @@ @@ -26,12 +26,12 @@ echo 'This is foo' >foo chmod +x foo test_expect_success setup \ - 'git-update-index --add foo' + 'git update-index --add foo' test_expect_success apply \ - 'git-apply --index --stat --summary --apply test-patch' + 'git apply --index --stat --summary --apply test-patch' -if [ "$(git repo-config --get core.filemode)" = false ] +if [ "$(git config --get core.filemode)" = false ] then say 'filemode disabled on the filesystem' else @@ -39,4 +39,24 @@ else 'test -f bar && ls -l bar | grep "^-..x......"' fi +test_expect_success 'apply reverse' \ + 'git apply -R --index --stat --summary --apply test-patch && + test "$(cat foo)" = "This is foo"' + +cat >test-patch <<\EOF +diff --git a/foo b/bar +similarity index 47% +copy from foo +copy to bar +--- a/foo ++++ b/bar +@@ -1 +1 @@ +-This is foo ++This is bar +EOF + +test_expect_success 'apply copy' \ + 'git apply --index --stat --summary --apply test-patch && + test "$(cat bar)" = "This is bar" -a "$(cat foo)" = "This is foo"' + test_done