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

Method Ref

storage/filesystem/dotgit/dotgit.go:721–728  ·  view source on GitHub ↗

Ref returns the reference for a given reference name.

(name plumbing.ReferenceName)

Source from the content-addressed store, hash-verified

719
720// Ref returns the reference for a given reference name.
721func (d *DotGit) Ref(name plumbing.ReferenceName) (*plumbing.Reference, error) {
722 ref, err := d.readReferenceFile(".", name.String())
723 if err == nil {
724 return ref, nil
725 }
726
727 return d.packedRef(name)
728}
729
730func (d *DotGit) findPackedRefsInFile(f billy.File, recv refsRecv) error {
731 s := bufio.NewScanner(f)

Callers 4

ReferenceMethod · 0.80
testSetRefsFunction · 0.80
TestPackRefsMethod · 0.80

Calls 3

readReferenceFileMethod · 0.95
packedRefMethod · 0.95
StringMethod · 0.65

Tested by 3

testSetRefsFunction · 0.64
TestPackRefsMethod · 0.64