aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/pktline/scanner.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/pktline/scanner.go')
-rw-r--r--plumbing/format/pktline/scanner.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/plumbing/format/pktline/scanner.go b/plumbing/format/pktline/scanner.go
index 5e85ed0..fbb137d 100644
--- a/plumbing/format/pktline/scanner.go
+++ b/plumbing/format/pktline/scanner.go
@@ -1,8 +1,10 @@
package pktline
import (
+ "bytes"
"errors"
"io"
+ "strings"
"github.com/go-git/go-git/v5/utils/trace"
)
@@ -69,6 +71,13 @@ func (s *Scanner) Scan() bool {
s.payload = s.payload[:l]
trace.Packet.Printf("packet: < %04x %s", l, s.payload)
+ if bytes.HasPrefix(s.payload, errPrefix) {
+ s.err = &ErrorLine{
+ Text: strings.TrimSpace(string(s.payload[4:])),
+ }
+ return false
+ }
+
return true
}