MCPcopy Create free account
hub / github.com/celer-pkg/celer / revParseCommit

Function revParseCommit

pkgs/git/local.go:392–399  ·  view source on GitHub ↗

revParseCommit returns the full commit hash for the given repo ref.

(repoDir, repoRef string)

Source from the content-addressed store, hash-verified

390
391// revParseCommit returns the full commit hash for the given repo ref.
392func revParseCommit(repoDir, repoRef string) (string, error) {
393 repoRef = strings.TrimSpace(repoRef)
394 if repoRef == "" {
395 return "", nil
396 }
397 // Force refs like annotated tags to resolve to the commit they point at.
398 return revParse(repoDir, repoRef+"^{commit}")
399}
400
401// revParse returns the full commit hash for the given repo ref from local repo.
402// The ref can be any valid git revision (branch, tag, HEAD, commit hash, etc.).

Callers 2

CheckIfRefMatchesFunction · 0.85
RevParseRepoRefFunction · 0.85

Calls 1

revParseFunction · 0.85

Tested by

no test coverage detected