MCPcopy Index your code
hub / github.com/git-lfs/git-lfs / parseRefFile

Function parseRefFile

git/git.go:1091–1101  ·  view source on GitHub ↗

Manually parse a reference file like HEAD and return the Ref it resolves to

(filename string)

Source from the content-addressed store, hash-verified

1089
1090// Manually parse a reference file like HEAD and return the Ref it resolves to
1091func parseRefFile(filename string) (*Ref, error) {
1092 bytes, err := os.ReadFile(filename)
1093 if err != nil {
1094 return nil, err
1095 }
1096 contents := strings.TrimSpace(string(bytes))
1097 if strings.HasPrefix(contents, "ref:") {
1098 contents = strings.TrimSpace(contents[4:])
1099 }
1100 return ResolveRef(contents)
1101}
1102
1103func parseDirFile(filename string) (string, error) {
1104 bytes, err := os.ReadFile(filename)

Callers 1

Calls 1

ResolveRefFunction · 0.85

Tested by

no test coverage detected