Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2018-07-02 03:23:47 +0300
committerJunio C Hamano <gitster@pobox.com>2018-07-03 22:38:04 +0300
commitfb23bd7af232d05d415653dc4d80b634a428f76f (patch)
treea51c71d9a0e8df028fb0b5356a526607ddf22427 /t/t5406-remote-rejects.sh
parentfbd6ef273e1d1d88a4056b986bd8a331cc61ea39 (diff)
t5406: use write_script() instead of birthing shell script manually
Take advantage of write_script() to abstract-away details of shell script creation, thus allowing the reader to focus on script content. Readability benefits, particularly in this case, since the script body was buried in a noisy one-liner subshell responsible for emitting boilerplate and body. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5406-remote-rejects.sh')
-rwxr-xr-xt/t5406-remote-rejects.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/t/t5406-remote-rejects.sh b/t/t5406-remote-rejects.sh
index 59e80a5ea2..ff06f99649 100755
--- a/t/t5406-remote-rejects.sh
+++ b/t/t5406-remote-rejects.sh
@@ -6,8 +6,9 @@ test_description='remote push rejects are reported by client'
test_expect_success 'setup' '
mkdir .git/hooks &&
- (echo "#!/bin/sh" ; echo "exit 1") >.git/hooks/update &&
- chmod +x .git/hooks/update &&
+ write_script .git/hooks/update <<-\EOF &&
+ exit 1
+ EOF
echo 1 >file &&
git add file &&
git commit -m 1 &&