diff --git a/plumbing/transport/ssh/common.go b/plumbing/transport/ssh/common.go index b0dbbaa6e..46e79134c 100644 --- a/plumbing/transport/ssh/common.go +++ b/plumbing/transport/ssh/common.go @@ -3,11 +3,10 @@ package ssh import ( "context" - "errors" "fmt" - "net" "reflect" "strconv" + "strings" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/internal/common" @@ -94,7 +93,8 @@ func (c *command) Close() error { _ = c.Session.Close() err := c.client.Close() - if errors.Is(err, net.ErrClosed) { + //XXX: in go1.16+ we can use errors.Is(err, net.ErrClosed) + if err != nil && strings.HasSuffix(err.Error(), "use of closed network connection") { return nil }