MCPcopy Create free account
hub / github.com/go-git/go-git / Encode

Method Encode

plumbing/protocol/packp/shallowupd.go:76–92  ·  view source on GitHub ↗
(w io.Writer)

Source from the content-addressed store, hash-verified

74}
75
76func (r *ShallowUpdate) Encode(w io.Writer) error {
77 e := pktline.NewEncoder(w)
78
79 for _, h := range r.Shallows {
80 if err := e.Encodef("%s%s\n", shallow, h.String()); err != nil {
81 return err
82 }
83 }
84
85 for _, h := range r.Unshallows {
86 if err := e.Encodef("%s%s\n", unshallow, h.String()); err != nil {
87 return err
88 }
89 }
90
91 return e.Flush()
92}

Callers 4

TestEncodeEmptyMethod · 0.95
TestEncodeMethod · 0.95
TestEncodeShallowMethod · 0.95
TestEncodeUnshallowMethod · 0.95

Calls 4

EncodefMethod · 0.95
FlushMethod · 0.95
NewEncoderFunction · 0.92
StringMethod · 0.65

Tested by 4

TestEncodeEmptyMethod · 0.76
TestEncodeMethod · 0.76
TestEncodeShallowMethod · 0.76
TestEncodeUnshallowMethod · 0.76