[GSoC PATCH 03/16] t6411: avoid suppressing git's exit code
- From
Trieu Huynh <vikingtc4@gmail.com>
- Date
- Mar 28, 2026, 20:02 UTC
- Message-ID
- <20260328200255.247759-4-vikingtc4@gmail.com>
- In-Reply-To
- <20260328200255.247759-1-vikingtc4@gmail.com>
Update t6411-merge-filemode.sh to redirect git-cmds 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.
Signed-off-by: Trieu Huynh <vikingtc4@gmail.com> --- t/t6411-merge-filemode.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/t6411-merge-filemode.sh b/t/t6411-merge-filemode.sh index 6ae2489286..9fe4271555 100755 --- a/t/t6411-merge-filemode.sh +++ b/t/t6411-merge-filemode.sh @@ -27,7 +27,8 @@ do_one_mode () { test_expect_success "resolve single mode change ($strategy, $us)" ' git checkout -f $us && git merge -s $strategy $them && - git ls-files -s file1 | grep ^100755 + git ls-files -s file1 >actual && + test_grep "^100755" actual ' test_expect_success FILEMODE "verify executable bit on file ($strategy, $us)" ' @@ -65,7 +66,8 @@ do_both_modes () { test_must_fail git merge -s $strategy b2 && git ls-files -u >actual && test_cmp expect actual && - git ls-files -s file2 | grep ^100755 + git ls-files -s file2 >actual && + test_grep "^100755" actual ' test_expect_success FILEMODE "verify executable bit on file ($strategy)" '
-- 2.43.0