aboutsummaryrefslogtreecommitdiff
path: root/t/t7502-commit.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7502-commit.sh')
-rwxr-xr-xt/t7502-commit.sh20
1 files changed, 7 insertions, 13 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 181456aa9..ddce53a96 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -266,13 +266,10 @@ test_expect_success 'committer is automatic' '
test_i18ncmp expect actual
'
-pwd=`pwd`
-cat >> .git/FAKE_EDITOR << EOF
-#! /bin/sh
-echo editor started > "$pwd/.git/result"
+write_script .git/FAKE_EDITOR <<EOF
+echo editor started > "$(pwd)/.git/result"
exit 0
EOF
-chmod +x .git/FAKE_EDITOR
test_expect_success 'do not fire editor in the presence of conflicts' '
@@ -300,9 +297,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
test "$(cat .git/result)" = "editor not started"
'
-pwd=`pwd`
-cat >.git/FAKE_EDITOR <<EOF
-#! $SHELL_PATH
+write_script .git/FAKE_EDITOR <<EOF
# kill -TERM command added below.
EOF
@@ -339,13 +334,12 @@ test_expect_success 'A single-liner subject with a token plus colon is not a foo
'
-cat >.git/FAKE_EDITOR <<EOF
-#!$SHELL_PATH
-mv "\$1" "\$1.orig"
+write_script .git/FAKE_EDITOR <<\EOF
+mv "$1" "$1.orig"
(
echo message
- cat "\$1.orig"
-) >"\$1"
+ cat "$1.orig"
+) >"$1"
EOF
echo '## Custom template' >template