Ignore EPIPE when forwarding pr diff output to pager

This commit is contained in:
Mislav Marohnić 2020-09-14 15:30:10 +02:00
parent b2e7f0c1e2
commit 6ad6784c46

View file

@ -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
}