(t *testing.T, branch string)
| 17 | } |
| 18 | |
| 19 | func makeRepoOnBranch(t *testing.T, branch string) string { |
| 20 | t.Helper() |
| 21 | root := t.TempDir() |
| 22 | |
| 23 | runGitTestCmd(t, root, "init") |
| 24 | |
| 25 | if err := os.WriteFile(filepath.Join(root, "main.go"), []byte("package main\n"), 0644); err != nil { |
| 26 | t.Fatal(err) |
| 27 | } |
| 28 | runGitTestCmd(t, root, "add", ".") |
| 29 | runGitTestCmd(t, root, "-c", "user.name=Test", "-c", "user.email=test@example.com", "commit", "-m", "init") |
| 30 | runGitTestCmd(t, root, "branch", "-M", branch) |
| 31 | |
| 32 | return root |
| 33 | } |
| 34 | |
| 35 | func TestResolveHandoffBaseRef(t *testing.T) { |
| 36 | if _, err := exec.LookPath("git"); err != nil { |
no test coverage detected