Subject: [PATCH v9 2/8] t2400: print captured git output when finished

From: Jacob Abel <[email-masked]>
Date: Mon, 17 Apr 2023 09:33:44 +0000

Update tests that capture stderr so that at the end of the test they
print the captured text back out to stderr. This simplifies debugging
when inspecting test logs after executing with `-x`.

Signed-off-by: Jacob Abel <[email-masked]>
---
 t/t2400-worktree-add.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh
index d587e0b20d..9bc3db20e4 100755
--- a/t/t2400-worktree-add.sh
+++ b/t/t2400-worktree-add.sh
@@ -326,6 +326,8 @@ test_expect_success 'add -B' '
 '

 test_expect_success 'add --quiet' '
+	test_when_finished "git worktree remove -f -f another-worktree" &&
+	test_when_finished cat actual >&2 &&
 	git worktree add --quiet another-worktree main 2>actual &&
 	test_must_be_empty actual
 '
--
2.39.2