diff mbox series

[v6,8/8] t7004: make use of write_script

Message ID 20240808163302.17521-9-abdobngad@gmail.com (mailing list archive)
State Accepted
Commit 203a9bf091499c4b9eae28fc1a40818031af493a
Headers show
Series t7004: modernize the style | expand

Commit Message

AbdAlRahman Gad Aug. 8, 2024, 4:32 p.m. UTC
Use write_script which takes care of emitting the `#!/bin/sh` line
and the `chmod +x`.

Signed-off-by: AbdAlRahman Gad <abdobngad@gmail.com>
---
 t/t7004-tag.sh | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 046a5bd9bc..b1316e62f4 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -974,13 +974,11 @@  test_expect_success GPG 'sign with an unknown id (2)' '
 '
 
 test_expect_success GPG '-u implies signed tag' '
-	cat >fakeeditor <<-\EOF &&
-	#!/bin/sh
+	write_script fakeeditor <<-\EOF &&
 	test -n "$1" && exec >"$1"
 	echo A signed tag message
 	echo from a fake editor.
 	EOF
-	chmod +x fakeeditor &&
 
 	get_tag_header implied-sign $commit commit $time >expect &&
 	./fakeeditor >>expect &&
@@ -1415,11 +1413,9 @@  test_expect_success GPG,RFC1991 'creating a signed tag with rfc1991' '
 '
 
 test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' '
-	cat >fakeeditor <<-\EOF &&
-	#!/bin/sh
+	write_script fakeeditor <<-\EOF &&
 	cp "$1" actual
 	EOF
-	chmod +x fakeeditor &&
 	echo "rfc1991" >gpghome/gpg.conf &&
 	echo "RFC1991 signed tag" >expect &&
 	GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&