@@ -661,6 +661,13 @@ test_expect_success 'setup trace2' '
661
661
export GIT_TRACE2_BRIEF
662
662
'
663
663
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
+
664
671
test_expect_success TTY ' git returns SIGPIPE on early pager exit' '
665
672
test_when_finished "rm pager-used trace.normal" &&
666
673
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' '
670
677
671
678
if test_have_prereq !MINGW
672
679
then
673
- OUT=$( (( test_terminal git log; echo $? 1>&3) | :) 3>&1 ) &&
680
+ { test_terminal git log >/dev/null; OUT=$?; } &&
674
681
test_match_signal 13 "$OUT"
675
682
else
676
683
test_terminal git log
@@ -691,7 +698,7 @@ test_expect_success TTY 'git returns SIGPIPE on early pager non-zero exit' '
691
698
692
699
if test_have_prereq !MINGW
693
700
then
694
- OUT=$( (( test_terminal git log; echo $? 1>&3) | :) 3>&1 ) &&
701
+ { test_terminal git log >/dev/null; OUT=$?; } &&
695
702
test_match_signal 13 "$OUT"
696
703
else
697
704
test_terminal git log
@@ -710,55 +717,22 @@ test_expect_success TTY 'git discards pager non-zero exit without SIGPIPE' '
710
717
export GIT_TRACE2 &&
711
718
test_when_finished "unset GIT_TRACE2" &&
712
719
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 &&
720
721
721
722
grep child_exit trace.normal >child-exits &&
722
723
test_line_count = 1 child-exits &&
723
724
grep " code:1 " child-exits &&
724
725
test_path_is_file pager-used
725
726
'
726
727
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' '
749
729
test_when_finished "rm trace.normal" &&
750
730
test_config core.pager "does-not-exist" &&
751
731
GIT_TRACE2="$(pwd)/trace.normal" &&
752
732
export GIT_TRACE2 &&
753
733
test_when_finished "unset GIT_TRACE2" &&
754
734
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 &&
762
736
763
737
grep child_exit trace.normal >child-exits &&
764
738
test_line_count = 1 child-exits &&
@@ -767,14 +741,14 @@ test_expect_success TTY 'git attempts to page to nonexisting pager command, gets
767
741
768
742
test_expect_success TTY ' git returns SIGPIPE on propagated signals from pager' '
769
743
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" &&
771
745
GIT_TRACE2="$(pwd)/trace.normal" &&
772
746
export GIT_TRACE2 &&
773
747
test_when_finished "unset GIT_TRACE2" &&
774
748
775
749
if test_have_prereq !MINGW
776
750
then
777
- OUT=$( (( test_terminal git log; echo $? 1>&3) | :) 3>&1 ) &&
751
+ { test_terminal git log >/dev/null; OUT=$?; } &&
778
752
test_match_signal 13 "$OUT"
779
753
else
780
754
test_terminal git log
0 commit comments