(ref string)
| 5137 | } |
| 5138 | |
| 5139 | func gitRefExists(ref string) (bool, error) { |
| 5140 | cmd := exec.Command("git", "rev-parse", "--verify", "--quiet", ref) |
| 5141 | if err := cmd.Run(); err != nil { |
| 5142 | var exitErr *exec.ExitError |
| 5143 | if errors.As(err, &exitErr) { |
| 5144 | return false, nil |
| 5145 | } |
| 5146 | return false, err |
| 5147 | } |
| 5148 | |
| 5149 | return true, nil |
| 5150 | } |
| 5151 | |
| 5152 | func runGitCommandInDir(ctx *snap.Context, dir string, args ...string) error { |
| 5153 | cmd := exec.Command("git", args...) |
no outgoing calls
no test coverage detected