--- git-backed helpers ---
(t *testing.T, dir string, args ...string)
| 260 | // --- git-backed helpers --- |
| 261 | |
| 262 | func runGit(t *testing.T, dir string, args ...string) { |
| 263 | t.Helper() |
| 264 | full := append([]string{ |
| 265 | "-C", dir, |
| 266 | "-c", "user.name=test", |
| 267 | "-c", "user.email=test@example.com", |
| 268 | "-c", "protocol.file.allow=always", |
| 269 | }, args...) |
| 270 | cmd := exec.Command("git", full...) |
| 271 | if out, err := cmd.CombinedOutput(); err != nil { |
| 272 | t.Fatalf("git %v: %v\n%s", args, err, out) |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | // newLocalGitRepo creates a repo with one commit on branch main and |
| 277 | // returns its path. |
no outgoing calls
no test coverage detected