(ctx context.Context, ref string)
| 336 | } |
| 337 | |
| 338 | func revParse(ctx context.Context, ref string) (string, error) { |
| 339 | out, err := runGit(ctx, "rev-parse", ref) |
| 340 | if err != nil { |
| 341 | return "", fmt.Errorf("git rev-parse %s (%s): %s", ref, err, out) |
| 342 | } |
| 343 | return strings.TrimSpace(out), nil |
| 344 | } |
| 345 | |
| 346 | func runGit(ctx context.Context, args ...string) (string, error) { |
| 347 | out, err := exec.CommandContext(ctx, "git", args...).CombinedOutput() |
no test coverage detected