Skip to contentSkip to conversation

t6101: avoid suppressing git's exit code

PATCH New Trieu Huynh 1 participant 1 message Mar 28

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t6101: avoid suppressing git's exit code

Update t6101-rev-parse-parents.sh to redirect git-rev-parse output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.

---
 t/t6101-rev-parse-parents.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
t/t6101-rev-parse-parents.sh +2 -1
index 5f55ab98d3..7281889717 100755
@@ -39,7 +39,8 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'start is valid' '
-	git rev-parse start | grep "^$OID_REGEX$"
+	git rev-parse start >actual &&
+	test_grep "^$OID_REGEX$" actual
 '
 
 test_expect_success 'start^0' '
Signature · 1 line
2.43.0