git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: AbdAlRahman Gad <abdobngad@gmail.com>
To: git@vger.kernel.org
Cc: AbdAlRahman Gad <abdobngad@gmail.com>
Subject: [PATCH v5 8/8] t7004: make use of write_script
Date: Wed,  7 Aug 2024 15:58:44 +0300	[thread overview]
Message-ID: <20240807130259.28381-9-abdobngad@gmail.com> (raw)
In-Reply-To: <20240807130259.28381-1-abdobngad@gmail.com>

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 --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 &&
-- 
2.43.0


  parent reply	other threads:[~2024-08-07 13:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07 12:58 [PATCH v5 0/8] [Newcomer] t7004: modernize the style AbdAlRahman Gad
2024-08-07 12:58 ` [PATCH v5 1/8] t7004: remove space after redirect operators AbdAlRahman Gad
2024-08-07 12:58 ` [PATCH v5 2/8] t7004: one command per line AbdAlRahman Gad
2024-08-07 12:58 ` [PATCH v5 3/8] t7004: do not prepare things outside test_expect_success AbdAlRahman Gad
2024-08-07 12:58 ` [PATCH v5 4/8] t7004: use indented here-doc AbdAlRahman Gad
2024-08-07 12:58 ` [PATCH v5 5/8] t7004: description on the same line as test_expect_success AbdAlRahman Gad
2024-08-07 12:58 ` [PATCH v5 6/8] t7004: test description and test body seperated with backslash AbdAlRahman Gad
2024-08-07 12:58 ` [PATCH v5 7/8] t7004: use single quotes instead of double quotes AbdAlRahman Gad
2024-08-08 15:36   ` Junio C Hamano
2024-08-07 12:58 ` AbdAlRahman Gad [this message]
2024-08-08 15:42 ` [PATCH v5 0/8] [Newcomer] t7004: modernize the style Junio C Hamano
2024-08-08 16:18   ` AbdAlRahman Gad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240807130259.28381-9-abdobngad@gmail.com \
    --to=abdobngad@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).