diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-10-22 16:37:36 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-23 12:29:28 -0700 |
commit | 0d6dd4df8af63d4655c5f739ce77086df2e120c1 (patch) | |
tree | 574a69a7a199d3dd717989013eb81d55a6d4276a | |
parent | fe7a859814625c31560168ddbffee64d63f50005 (diff) | |
download | git-0d6dd4df8af63d4655c5f739ce77086df2e120c1.tar.gz |
t4102: modernise style
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | t/t4102-apply-rename.sh | 98 |
1 files changed, 51 insertions, 47 deletions
diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh index fae305979a..3aaae2f94c 100755 --- a/t/t4102-apply-rename.sh +++ b/t/t4102-apply-rename.sh @@ -3,55 +3,59 @@ # 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 -# setup - -cat >test-patch <<\EOF -diff --git a/foo b/bar -similarity index 47% -rename from foo -rename to bar ---- a/foo -+++ b/bar -@@ -1 +1 @@ --This is foo -+This is bar -EOF - -echo 'This is foo' >foo -chmod +x foo - -test_expect_success setup \ - 'git update-index --add foo' - -test_expect_success apply \ - 'git apply --index --stat --summary --apply test-patch' - -test_expect_success FILEMODE validate \ - 'test -f bar && ls -l bar | grep "^-..x......"' - -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" && test "$(cat foo)" = "This is foo"' +test_expect_success setup ' + cat >test-patch <<-\EOF && + diff --git a/foo b/bar + similarity index 47% + rename from foo + rename to bar + --- a/foo + +++ b/bar + @@ -1 +1 @@ + -This is foo + +This is bar + EOF + + echo "This is foo" >foo && + chmod +x foo && + git update-index --add foo +' + +test_expect_success apply ' + git apply --index --stat --summary --apply test-patch +' + +test_expect_success FILEMODE validate ' + test -x bar +' + +test_expect_success 'apply reverse' ' + git apply -R --index --stat --summary --apply test-patch && + test "$(cat foo)" = "This is foo" +' + +test_expect_success 'apply copy' ' + 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" && + test "$(cat foo)" = "This is foo" +' test_done |