Use write_script from t/ instead of cat, shebang,
and chmod. This aids in readability for creating the script by using the
named function and allows us to turn off interpolation in the heredoc of
the script body to avoid extra escaping, since $SHELL_PATH is handled
for us.

Signed-off-by: Caleb Thompson <>
Reviewed-by: Jeremiah Mahler <>
 t/ | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/t/ b/t/
index 6d778ed..db09107 100755
--- a/t/
+++ b/t/
@@ -3,11 +3,9 @@
 test_description='verbose commit template'
 . ./
-cat >check-for-diff <<EOF
-exec grep '^diff --git' "\$1"
+write_script check-for-diff <<-'EOF'
+       exec grep '^diff --git' "$1"
-chmod +x check-for-diff
 test_set_editor "$PWD/check-for-diff"
 cat >message <<'EOF'

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to