(ref string)
| 45 | } |
| 46 | |
| 47 | func 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 | |
| 60 | func validateGitRelPath(path string) error { |
| 61 | if path == "" { |
no outgoing calls
no test coverage detected