MCPcopy Create free account
hub / github.com/LegacyCodeHQ/clarity-cli / getHEADSignature

Function getHEADSignature

vcs/git/git_state.go:26–37  ·  view source on GitHub ↗
(repoPath string)

Source from the content-addressed store, hash-verified

24}
25
26func getHEADSignature(repoPath string) (string, error) {
27 head, stderr, err := runGitCommand(repoPath, "rev-parse", "--verify", "HEAD")
28 if err == nil {
29 return strings.TrimSpace(string(head)), nil
30 }
31
32 if strings.Contains(strings.ToLower(stderr), "needed a single revision") {
33 return unbornHeadSignature, nil
34 }
35
36 return "", gitCommandError(err, stderr)
37}

Callers 1

Calls 2

runGitCommandFunction · 0.85
gitCommandErrorFunction · 0.85

Tested by

no test coverage detected