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

Method encodeFirstWant

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

Source from the content-addressed store, hash-verified

48}
49
50func (e *ulReqEncoder) encodeFirstWant() stateFn {
51 var err error
52 if e.data.Capabilities.IsEmpty() {
53 err = e.pe.Encodef("want %s\n", e.data.Wants[0])
54 } else {
55 err = e.pe.Encodef(
56 "want %s %s\n",
57 e.data.Wants[0],
58 e.data.Capabilities.String(),
59 )
60 }
61
62 if err != nil {
63 e.err = fmt.Errorf("encoding first want line: %s", err)
64 return nil
65 }
66
67 return e.encodeAdditionalWants
68}
69
70func (e *ulReqEncoder) encodeAdditionalWants() stateFn {
71 last := e.data.Wants[0]

Callers

nothing calls this directly

Calls 3

EncodefMethod · 0.80
StringMethod · 0.65
IsEmptyMethod · 0.45

Tested by

no test coverage detected