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

Function encodePrefix

plumbing/protocol/packp/advrefs_encode.go:80–94  ·  view source on GitHub ↗
(e *advRefsEncoder)

Source from the content-addressed store, hash-verified

78type encoderStateFn func(*advRefsEncoder) encoderStateFn
79
80func encodePrefix(e *advRefsEncoder) encoderStateFn {
81 for _, p := range e.data.Prefix {
82 if bytes.Equal(p, pktline.Flush) {
83 if e.err = e.pe.Flush(); e.err != nil {
84 return nil
85 }
86 continue
87 }
88 if e.err = e.pe.Encodef("%s\n", string(p)); e.err != nil {
89 return nil
90 }
91 }
92
93 return encodeFirstLine
94}
95
96// Adds the first pkt-line payload: head hash, head ref and capabilities.
97// If HEAD ref is not found, the first reference ordered in increasing order will be used.

Callers

nothing calls this directly

Calls 2

EncodefMethod · 0.80
FlushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…