File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 7
7
"errors"
8
8
"fmt"
9
9
"io"
10
+
11
+ "github.com/go-git/go-git/v5/utils/trace"
10
12
)
11
13
12
14
// An Encoder writes pkt-lines to an output stream.
@@ -43,6 +45,7 @@ func NewEncoder(w io.Writer) *Encoder {
43
45
44
46
// Flush encodes a flush-pkt to the output stream.
45
47
func (e * Encoder ) Flush () error {
48
+ defer trace .Packet .Print ("packet: > 0000" )
46
49
_ , err := e .w .Write (FlushPkt )
47
50
return err
48
51
}
@@ -70,6 +73,7 @@ func (e *Encoder) encodeLine(p []byte) error {
70
73
}
71
74
72
75
n := len (p ) + 4
76
+ defer trace .Packet .Printf ("packet: > %04x %s" , n , p )
73
77
if _ , err := e .w .Write (asciiHex16 (n )); err != nil {
74
78
return err
75
79
}
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ package pktline
3
3
import (
4
4
"errors"
5
5
"io"
6
+
7
+ "github.com/go-git/go-git/v5/utils/trace"
6
8
)
7
9
8
10
const (
@@ -65,6 +67,7 @@ func (s *Scanner) Scan() bool {
65
67
return false
66
68
}
67
69
s .payload = s .payload [:l ]
70
+ trace .Packet .Printf ("packet: < %04x %s" , l , s .payload )
68
71
69
72
return true
70
73
}
You can’t perform that action at this time.
0 commit comments