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

Method setFirstRef

plumbing/protocol/packp/advrefs_encode.go:64–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64func (e *advRefsEncoder) setFirstRef() {
65 if e.data.Head != nil {
66 e.firstRefName = head
67 e.firstRefHash = *e.data.Head
68 return
69 }
70
71 if len(e.sortedRefs) > 0 {
72 refName := e.sortedRefs[0]
73 e.firstRefName = refName
74 e.firstRefHash = e.data.References[refName]
75 }
76}
77
78type encoderStateFn func(*advRefsEncoder) encoderStateFn
79

Callers 1

EncodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected