MCPcopy Index your code
hub / github.com/go-git/go-git / Ref

Method Ref

storage/filesystem/dotgit/dotgit.go:743–750  ·  view source on GitHub ↗

Ref returns the reference for a given reference name.

(name plumbing.ReferenceName)

Source from the content-addressed store, hash-verified

741
742// Ref returns the reference for a given reference name.
743func (d *DotGit) Ref(name plumbing.ReferenceName) (*plumbing.Reference, error) {
744 ref, err := d.readReferenceFile(".", name.String())
745 if err == nil {
746 return ref, nil
747 }
748
749 return d.packedRef(name)
750}
751
752func (d *DotGit) findPackedRefsInFile(f billy.File, recv refsRecv) error {
753 s := bufio.NewScanner(f)

Callers 5

ReferenceMethod · 0.80
testSetRefsFunction · 0.80
TestPackRefsMethod · 0.80
TestSetPackedRefMethod · 0.80

Calls 3

readReferenceFileMethod · 0.95
packedRefMethod · 0.95
StringMethod · 0.65

Tested by 4

testSetRefsFunction · 0.64
TestPackRefsMethod · 0.64
TestSetPackedRefMethod · 0.64