Skip to content

Commit 6ad6784

Browse files
committed
Ignore EPIPE when forwarding pr diff output to pager
1 parent b2e7f0c commit 6ad6784

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cmd/pr/diff/diff.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"io"
88
"net/http"
99
"strings"
10+
"syscall"
1011

1112
"github.com/cli/cli/api"
1213
"github.com/cli/cli/context"
@@ -98,6 +99,9 @@ func diffRun(opts *DiffOptions) error {
9899

99100
if opts.UseColor == "never" {
100101
_, err = io.Copy(opts.IO.Out, diff)
102+
if errors.Is(err, syscall.EPIPE) {
103+
return nil
104+
}
101105
return err
102106
}
103107

0 commit comments

Comments
 (0)