t2400: avoid losing exit status to pipes
commit425ae8a3df3d2378e8da5a96b995f8fc0fac32e8
authorAchu Luma <ach.lumap@gmail.com>
Sat, 20 Jan 2024 02:15:47 +0000 (20 03:15 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 20 Jan 2024 18:27:18 +0000 (20 10:27 -0800)
tree4044ed31184884d6ccd1e54716c5b797d1bcf3e7
parente02ecfcc534e2021aae29077a958dd11c3897e4c
t2400: avoid losing exit status to pipes

The exit code of the preceding command in a pipe is disregarded. So
if that preceding command is a Git command that fails, the test would
not fail. Instead, by saving the output of that Git command to a file,
and removing the pipe, we make sure the test will fail if that Git
command fails.

Signed-off-by: Achu Luma <ach.lumap@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t2400-worktree-add.sh