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

Method String

plumbing/reference.go:297–315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

295}
296
297func (r *Reference) String() string {
298 ref := ""
299 switch r.Type() {
300 case HashReference:
301 ref = r.Hash().String()
302 case SymbolicReference:
303 ref = symrefPrefix + r.Target().String()
304 default:
305 return ""
306 }
307
308 name := r.Name().String()
309 var v strings.Builder
310 v.Grow(len(ref) + len(name) + 1)
311 v.WriteString(ref)
312 v.WriteString(" ")
313 v.WriteString(name)
314 return v.String()
315}

Callers

nothing calls this directly

Calls 5

TypeMethod · 0.95
HashMethod · 0.95
TargetMethod · 0.95
NameMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected