From 6ad6784c4654d661a421ff6323cf641397eb73fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 14 Sep 2020 15:30:10 +0200 Subject: [PATCH] Ignore EPIPE when forwarding `pr diff` output to pager --- pkg/cmd/pr/diff/diff.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/cmd/pr/diff/diff.go b/pkg/cmd/pr/diff/diff.go index 3c55e7db8..2bea8072b 100644 --- a/pkg/cmd/pr/diff/diff.go +++ b/pkg/cmd/pr/diff/diff.go @@ -7,6 +7,7 @@ import ( "io" "net/http" "strings" + "syscall" "github.com/cli/cli/api" "github.com/cli/cli/context" @@ -98,6 +99,9 @@ func diffRun(opts *DiffOptions) error { if opts.UseColor == "never" { _, err = io.Copy(opts.IO.Out, diff) + if errors.Is(err, syscall.EPIPE) { + return nil + } return err }