()
| 5069 | } |
| 5070 | |
| 5071 | func ensureGitRepository() error { |
| 5072 | cmd := exec.Command("git", "rev-parse", "--is-inside-work-tree") |
| 5073 | out, err := cmd.CombinedOutput() |
| 5074 | if err != nil { |
| 5075 | trimmed := strings.TrimSpace(string(out)) |
| 5076 | if trimmed != "" { |
| 5077 | return fmt.Errorf("%s", trimmed) |
| 5078 | } |
| 5079 | return fmt.Errorf("git rev-parse --is-inside-work-tree: %w", err) |
| 5080 | } |
| 5081 | |
| 5082 | if strings.TrimSpace(string(out)) != "true" { |
| 5083 | return fmt.Errorf("not inside a git repository") |
| 5084 | } |
| 5085 | |
| 5086 | return nil |
| 5087 | } |
| 5088 | |
| 5089 | func listGitRemotes() ([]string, error) { |
| 5090 | out, err := exec.Command("git", "remote").Output() |
no outgoing calls
no test coverage detected