Commit be8fc53
pager: properly log pager exit code when signalled
When git invokes a pager that exits with non-zero the common case is
that we'll already return the correct SIGPIPE failure from git itself,
but the exit code logged in trace2 has always been incorrectly
reported[1]. Fix that and log the correct exit code in the logs.
Since this gives us something to test outside of our recently-added
tests needing a !MINGW prerequisite, let's refactor the test to run on
MINGW and actually check for SIGPIPE outside of MINGW.
The wait_or_whine() is only called with a true "in_signal" from from
finish_command_in_signal(), which in turn is only used in pager.c.
The "in_signal && !WIFEXITED(status)" case is not covered by
tests. Let's log the default -1 in that case for good measure.
1. The incorrect logging of the exit code in was seemingly copy/pasted
into finish_command_in_signal() in ee4512e (trace2: create new
combined trace facility, 2019-02-22)
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 85db79a commit be8fc53
2 files changed
+57
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
556 | 558 | | |
557 | 559 | | |
558 | 560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
659 | 664 | | |
660 | | - | |
| 665 | + | |
661 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
662 | 670 | | |
663 | 671 | | |
664 | 672 | | |
| |||
667 | 675 | | |
668 | 676 | | |
669 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
670 | 682 | | |
671 | 683 | | |
672 | 684 | | |
673 | 685 | | |
674 | | - | |
| 686 | + | |
675 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
676 | 691 | | |
677 | 692 | | |
678 | 693 | | |
| |||
681 | 696 | | |
682 | 697 | | |
683 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
684 | 703 | | |
685 | 704 | | |
686 | 705 | | |
687 | 706 | | |
688 | | - | |
| 707 | + | |
689 | 708 | | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
690 | 712 | | |
691 | 713 | | |
692 | 714 | | |
| |||
695 | 717 | | |
696 | 718 | | |
697 | 719 | | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
698 | 724 | | |
699 | 725 | | |
700 | 726 | | |
701 | 727 | | |
702 | | - | |
| 728 | + | |
703 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
704 | 733 | | |
705 | 734 | | |
706 | 735 | | |
| |||
709 | 738 | | |
710 | 739 | | |
711 | 740 | | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
712 | 745 | | |
713 | 746 | | |
714 | 747 | | |
715 | 748 | | |
| 749 | + | |
716 | 750 | | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
717 | 754 | | |
718 | 755 | | |
719 | 756 | | |
720 | 757 | | |
721 | 758 | | |
722 | 759 | | |
723 | 760 | | |
724 | | - | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
725 | 766 | | |
726 | 767 | | |
727 | 768 | | |
728 | | - | |
| 769 | + | |
729 | 770 | | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
730 | 774 | | |
731 | 775 | | |
732 | 776 | | |
| |||
735 | 779 | | |
736 | 780 | | |
737 | 781 | | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
738 | 786 | | |
739 | 787 | | |
740 | 788 | | |
| |||
0 commit comments