Skip to content

Commit 203a9bf

Browse files
AbdAlRahmanGadgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2f44f11 commit 203a9bf

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

t/t7004-tag.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -974,13 +974,11 @@ test_expect_success GPG 'sign with an unknown id (2)' '
974974
'
975975

976976
test_expect_success GPG '-u implies signed tag' '
977-
cat >fakeeditor <<-\EOF &&
978-
#!/bin/sh
977+
write_script fakeeditor <<-\EOF &&
979978
test -n "$1" && exec >"$1"
980979
echo A signed tag message
981980
echo from a fake editor.
982981
EOF
983-
chmod +x fakeeditor &&
984982
985983
get_tag_header implied-sign $commit commit $time >expect &&
986984
./fakeeditor >>expect &&
@@ -1415,11 +1413,9 @@ test_expect_success GPG,RFC1991 'creating a signed tag with rfc1991' '
14151413
'
14161414

14171415
test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' '
1418-
cat >fakeeditor <<-\EOF &&
1419-
#!/bin/sh
1416+
write_script fakeeditor <<-\EOF &&
14201417
cp "$1" actual
14211418
EOF
1422-
chmod +x fakeeditor &&
14231419
echo "rfc1991" >gpghome/gpg.conf &&
14241420
echo "RFC1991 signed tag" >expect &&
14251421
GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&

0 commit comments

Comments
 (0)