t7004: make use of write_script
Use write_script which takes care of emitting the `#!/bin/sh` line and the `chmod +x`. Signed-off-by: AbdAlRahman Gad <abdobngad@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
AbdAlRahman Gad committed
Aug 8, 2024 at 19:32 UTC
203a9bf091499c4b9eae28fc1a40818031af493a
1 file changed
+2
-6
t/t7004-tag.sh
+2
-6
@@ -974,13 +974,11 @@ test_expect_success GPG 'sign with an unknown id (2)' '
974
'
975
976
test_expect_success GPG '-u implies signed tag' '
977
- cat >fakeeditor <<-\EOF &&
978
- #!/bin/sh
977
+ write_script fakeeditor <<-\EOF &&
978
test -n "$1" && exec >"$1"
979
echo A signed tag message
980
echo from a fake editor.
981
EOF
983
- chmod +x fakeeditor &&
982
983
get_tag_header implied-sign $commit commit $time >expect &&
984
./fakeeditor >>expect &&
@@ -1415,11 +1413,9 @@ test_expect_success GPG,RFC1991 'creating a signed tag with rfc1991' '
1413
'
1414
1415
test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' '
1418
- cat >fakeeditor <<-\EOF &&
1419
- #!/bin/sh
1416
+ write_script fakeeditor <<-\EOF &&
1417
cp "$1" actual
1418
EOF
1422
- chmod +x fakeeditor &&
1419
echo "rfc1991" >gpghome/gpg.conf &&
1420
echo "RFC1991 signed tag" >expect &&
1421
GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&