t6423: fix suppression of Git’s exit code in tests

Some test in t6423 supress Git's exit code, which can cause test failures go unnoticed. Specifically using git <subcommand> | <other-command> masks potential failures of the Git command. This commit ensures that Git's exit status is correctly propogated by: - Avoiding pipes that suppress exit codes. Signed-off-by: Ayush Chandekar <ayu.chandekar@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ayush Chandekar committed Feb 2, 2025 at 17:39 UTC 7c1d34fe5d1229362f2c3ecf2d493167a1f555a2
1 file changed +6 -3
t/t6423-merge-rename-directories.sh
+6 -3
@@ -5071,7 +5071,8 @@ test_expect_success '12i: Directory rename causes rename-to-self' '
5071 test_path_is_file source/bar &&
5072 test_path_is_file source/baz &&
5073
5074 - git ls-files | uniq >tracked &&
5074 + git ls-files >actual &&
5075 + uniq <actual >tracked &&
5076 test_line_count = 3 tracked &&
5077
5078 git status --porcelain -uno >actual &&
@@ -5129,7 +5130,8 @@ test_expect_success '12j: Directory rename to root causes rename-to-self' '
5130 test_path_is_file bar &&
5131 test_path_is_file baz &&
5132
5132 - git ls-files | uniq >tracked &&
5133 + git ls-files >actual &&
5134 + uniq <actual >tracked &&
5135 test_line_count = 3 tracked &&
5136
5137 git status --porcelain -uno >actual &&
@@ -5187,7 +5189,8 @@ test_expect_success '12k: Directory rename with sibling causes rename-to-self' '
5189 test_path_is_file dirA/bar &&
5190 test_path_is_file dirA/baz &&
5191
5190 - git ls-files | uniq >tracked &&
5192 + git ls-files >actual &&
5193 + uniq <actual >tracked &&
5194 test_line_count = 3 tracked &&
5195
5196 git status --porcelain -uno >actual &&