From c3843453da23043b4a4dcb9f7968f72c1e4ae8cc Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 15 Nov 2023 16:53:42 -0500 Subject: plumbing: format/pktline: trace packets --- plumbing/format/pktline/encoder.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plumbing/format/pktline/encoder.go') 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 } -- cgit