aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/format/pktline/encoder.go4
-rw-r--r--plumbing/format/pktline/scanner.go3
2 files changed, 7 insertions, 0 deletions
diff --git a/plumbing/format/pktline/encoder.go b/plumbing/format/pktline/encoder.go
index 6d40979..1b9b84e 100644
--- a/plumbing/format/pktline/encoder.go
+++ b/plumbing/format/pktline/encoder.go
@@ -7,6 +7,8 @@ import (
"errors"
"fmt"
"io"
+
+ "github.com/go-git/go-git/v5/internal/trace"
)
// An Encoder writes pkt-lines to an output stream.
@@ -43,6 +45,7 @@ func NewEncoder(w io.Writer) *Encoder {
// Flush encodes a flush-pkt to the output stream.
func (e *Encoder) Flush() error {
+ defer trace.Packet.Print("packet: > 0000")
_, err := e.w.Write(FlushPkt)
return err
}
@@ -70,6 +73,7 @@ func (e *Encoder) encodeLine(p []byte) error {
}
n := len(p) + 4
+ defer trace.Packet.Printf("packet: > %04x %s", n, p)
if _, err := e.w.Write(asciiHex16(n)); err != nil {
return err
}
diff --git a/plumbing/format/pktline/scanner.go b/plumbing/format/pktline/scanner.go
index 99aab46..86068af 100644
--- a/plumbing/format/pktline/scanner.go
+++ b/plumbing/format/pktline/scanner.go
@@ -3,6 +3,8 @@ package pktline
import (
"errors"
"io"
+
+ "github.com/go-git/go-git/v5/internal/trace"
)
const (
@@ -65,6 +67,7 @@ func (s *Scanner) Scan() bool {
return false
}
s.payload = s.payload[:l]
+ trace.Packet.Printf("packet: < %04x %s", l, s.payload)
return true
}