diff mbox series

[v3,2/6,Newcomer] t7004-tag: do not lose exit status to pipe

Message ID 20240804071137.30326-3-abdobngad@gmail.com (mailing list archive)
State Superseded
Headers show
Series t7004: modernize the style | expand

Commit Message

AbdAlRahman Gad Aug. 4, 2024, 7:11 a.m. UTC
split "test-tool ... | sed" pipeline into two commands
to avoid losing exit status from test-tool

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

Comments

Patrick Steinhardt Aug. 5, 2024, 9:36 a.m. UTC | #1
On Sun, Aug 04, 2024 at 10:11:33AM +0300, AbdAlRahman Gad wrote:
> split "test-tool ... | sed" pipeline into two commands
> to avoid losing exit status from test-tool

The commit body should be a full sentence and thus should start with an
upper-case letter and end with punctuation.

I'd also drop the "-tag" from "t7004-tag" in the commit subject, as we
typically only mention the tag number.

Patrick
diff mbox series

Patch

diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 3100a4c219..1e31f39646 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -97,7 +97,8 @@  test_expect_success 'creating a tag with --create-reflog should create reflog' '
 	test_when_finished "git tag -d tag_with_reflog1" &&
 	git tag --create-reflog tag_with_reflog1 &&
 	git reflog exists refs/tags/tag_with_reflog1 &&
-	test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 | sed -e "s/^.*	//" >actual &&
+	test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 >actual.body &&
+	sed -e "s/^.*	//" actual.body >actual &&
 	test_cmp expected actual
 '
 
@@ -108,7 +109,8 @@  test_expect_success 'annotated tag with --create-reflog has correct message' '
 	test_when_finished "git tag -d tag_with_reflog2" &&
 	git tag -m "annotated tag" --create-reflog tag_with_reflog2 &&
 	git reflog exists refs/tags/tag_with_reflog2 &&
-	test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog2 | sed -e "s/^.*	//" >actual &&
+	test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog2 >actual.body &&
+	sed -e "s/^.*	//" actual.body >actual &&
 	test_cmp expected actual
 '