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

Function validateGitRef

vcs/git/git.go:47–58  ·  view source on GitHub ↗
(ref string)

Source from the content-addressed store, hash-verified

45}
46
47func validateGitRef(ref string) error {
48 if ref == "" {
49 return fmt.Errorf("git reference cannot be empty")
50 }
51 if strings.HasPrefix(ref, "-") {
52 return fmt.Errorf("git reference cannot start with '-': %q", ref)
53 }
54 if strings.ContainsAny(ref, "\x00\n\r\t ") {
55 return fmt.Errorf("git reference contains whitespace or NUL: %q", ref)
56 }
57 return nil
58}
59
60func validateGitRelPath(path string) error {
61 if path == "" {

Callers 5

validateCommitFunction · 0.85
GetShortCommitHashFunction · 0.85
isAncestorFunction · 0.85
GetCommitHistoryFunction · 0.85
GetFileContentFromCommitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected