Skip to content

Commit cc04adc

Browse files
szedergitster
authored andcommitted
t6022: don't run 'git merge' upstream of a pipe
The primary purpose of 't6022-merge-rename.sh' is to test 'git merge', but one of the tests runs it upstream of a pipe, hiding its exit code. Consequently, the test could continue even if 'git merge' exited with error. Use an intermediate file between 'git merge' and 'test_i18ngrep' to catch a potential failure of the former. Signed-off-by: SZEDER Gábor <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a4ca455 commit cc04adc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/t6022-merge-rename.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,12 @@ test_expect_success 'merge of identical changes in a renamed file' '
242242
rm -f A M N &&
243243
git reset --hard &&
244244
git checkout change+rename &&
245-
GIT_MERGE_VERBOSITY=3 git merge change | test_i18ngrep "^Skipped B" &&
245+
GIT_MERGE_VERBOSITY=3 git merge change >out &&
246+
test_i18ngrep "^Skipped B" out &&
246247
git reset --hard HEAD^ &&
247248
git checkout change &&
248-
GIT_MERGE_VERBOSITY=3 git merge change+rename | test_i18ngrep "^Skipped B"
249+
GIT_MERGE_VERBOSITY=3 git merge change+rename >out &&
250+
test_i18ngrep "^Skipped B" out
249251
'
250252

251253
test_expect_success 'setup for rename + d/f conflicts' '

0 commit comments

Comments
 (0)