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

Method encodeShallows

plumbing/protocol/packp/ulreq_encode.go:88–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86}
87
88func (e *ulReqEncoder) encodeShallows() stateFn {
89 plumbing.HashesSort(e.data.Shallows)
90
91 var last plumbing.Hash
92 for _, s := range e.data.Shallows {
93 if bytes.Equal(last[:], s[:]) {
94 continue
95 }
96
97 if err := e.pe.Encodef("shallow %s\n", s); err != nil {
98 e.err = fmt.Errorf("encoding shallow %q: %s", s, err)
99 return nil
100 }
101
102 last = s
103 }
104
105 return e.encodeDepth
106}
107
108func (e *ulReqEncoder) encodeDepth() stateFn {
109 switch depth := e.data.Depth.(type) {

Callers

nothing calls this directly

Calls 2

HashesSortFunction · 0.92
EncodefMethod · 0.80

Tested by

no test coverage detected