Skip to content

Commit

Permalink
Merge branch 'js/diff-highlight-avoid-sigpipe'
Browse files Browse the repository at this point in the history
* js/diff-highlight-avoid-sigpipe:
  diff-highlight: exit when a pipe is broken
  • Loading branch information
Junio C Hamano committed Nov 10, 2014
2 parents b226293 + 251e7da commit bd51886
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contrib/diff-highlight/diff-highlight
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ my @removed;
my @added;
my $in_hunk;

# Some scripts may not realize that SIGPIPE is being ignored when launching the
# pager--for instance scripts written in Python.
$SIG{PIPE} = 'DEFAULT';

while (<>) {
if (!$in_hunk) {
print;
Expand Down

0 comments on commit bd51886

Please sign in to comment.