Use write_script from t/ instead of cat, shebang,
and chmod. This protects us from potential shell meta-characters in the
name of our trash directory, which would be interpreted if we set
$EDITOR directly.

Signed-off-by: Caleb Thompson <>
 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