@@ -661,6 +661,13 @@ test_expect_success 'setup trace2' '
661661 export GIT_TRACE2_BRIEF
662662'
663663
664+ test_expect_success ' setup large log output' '
665+ perl -e "
666+ print \"this is a long commit message\" x 50000
667+ " >commit-msg &&
668+ git commit --allow-empty -F commit-msg
669+ '
670+
664671test_expect_success TTY ' git returns SIGPIPE on early pager exit' '
665672 test_when_finished "rm pager-used trace.normal" &&
666673 test_config core.pager ">pager-used; head -n 1; exit 0" &&
@@ -670,7 +677,7 @@ test_expect_success TTY 'git returns SIGPIPE on early pager exit' '
670677
671678 if test_have_prereq !MINGW
672679 then
673- OUT=$( (( test_terminal git log; echo $? 1>&3) | :) 3>&1 ) &&
680+ { test_terminal git log >/dev/null; OUT=$?; } &&
674681 test_match_signal 13 "$OUT"
675682 else
676683 test_terminal git log
@@ -691,7 +698,7 @@ test_expect_success TTY 'git returns SIGPIPE on early pager non-zero exit' '
691698
692699 if test_have_prereq !MINGW
693700 then
694- OUT=$( (( test_terminal git log; echo $? 1>&3) | :) 3>&1 ) &&
701+ { test_terminal git log >/dev/null; OUT=$?; } &&
695702 test_match_signal 13 "$OUT"
696703 else
697704 test_terminal git log
@@ -710,55 +717,22 @@ test_expect_success TTY 'git discards pager non-zero exit without SIGPIPE' '
710717 export GIT_TRACE2 &&
711718 test_when_finished "unset GIT_TRACE2" &&
712719
713- if test_have_prereq !MINGW
714- then
715- OUT=$( ((test_terminal git log; echo $? 1>&3) | :) 3>&1 ) &&
716- test "$OUT" -eq 0
717- else
718- test_terminal git log
719- fi &&
720+ test_terminal git log &&
720721
721722 grep child_exit trace.normal >child-exits &&
722723 test_line_count = 1 child-exits &&
723724 grep " code:1 " child-exits &&
724725 test_path_is_file pager-used
725726'
726727
727- test_expect_success TTY ' git discards nonexisting pager without SIGPIPE' '
728- test_when_finished "rm pager-used trace.normal" &&
729- test_config core.pager "wc >pager-used; does-not-exist" &&
730- GIT_TRACE2="$(pwd)/trace.normal" &&
731- export GIT_TRACE2 &&
732- test_when_finished "unset GIT_TRACE2" &&
733-
734- if test_have_prereq !MINGW
735- then
736- OUT=$( ((test_terminal git log; echo $? 1>&3) | :) 3>&1 ) &&
737- test "$OUT" -eq 0
738- else
739- test_terminal git log
740- fi &&
741-
742- grep child_exit trace.normal >child-exits &&
743- test_line_count = 1 child-exits &&
744- grep " code:127 " child-exits &&
745- test_path_is_file pager-used
746- '
747-
748- test_expect_success TTY ' git attempts to page to nonexisting pager command, gets SIGPIPE' '
728+ test_expect_success TTY ' git skips paging nonexisting command' '
749729 test_when_finished "rm trace.normal" &&
750730 test_config core.pager "does-not-exist" &&
751731 GIT_TRACE2="$(pwd)/trace.normal" &&
752732 export GIT_TRACE2 &&
753733 test_when_finished "unset GIT_TRACE2" &&
754734
755- if test_have_prereq !MINGW
756- then
757- OUT=$( ((test_terminal git log; echo $? 1>&3) | :) 3>&1 ) &&
758- test_match_signal 13 "$OUT"
759- else
760- test_terminal git log
761- fi &&
735+ test_terminal git log &&
762736
763737 grep child_exit trace.normal >child-exits &&
764738 test_line_count = 1 child-exits &&
@@ -767,14 +741,14 @@ test_expect_success TTY 'git attempts to page to nonexisting pager command, gets
767741
768742test_expect_success TTY ' git returns SIGPIPE on propagated signals from pager' '
769743 test_when_finished "rm pager-used trace.normal" &&
770- test_config core.pager ">pager-used; test-tool sigchain" &&
744+ test_config core.pager ">pager-used; exec test-tool sigchain" &&
771745 GIT_TRACE2="$(pwd)/trace.normal" &&
772746 export GIT_TRACE2 &&
773747 test_when_finished "unset GIT_TRACE2" &&
774748
775749 if test_have_prereq !MINGW
776750 then
777- OUT=$( (( test_terminal git log; echo $? 1>&3) | :) 3>&1 ) &&
751+ { test_terminal git log >/dev/null; OUT=$?; } &&
778752 test_match_signal 13 "$OUT"
779753 else
780754 test_terminal git log
0 commit comments