newLocalGitRepo creates a repo with one commit on branch main and returns its path.
(t *testing.T)
| 276 | // newLocalGitRepo creates a repo with one commit on branch main and |
| 277 | // returns its path. |
| 278 | func newLocalGitRepo(t *testing.T) string { |
| 279 | t.Helper() |
| 280 | dir := t.TempDir() |
| 281 | runGit(t, dir, "-c", "init.defaultBranch=main", "init") |
| 282 | writeTestFile(t, filepath.Join(dir, "main.go"), "package main\n") |
| 283 | runGit(t, dir, "add", ".") |
| 284 | runGit(t, dir, "commit", "-m", "feat: initial commit") |
| 285 | return dir |
| 286 | } |
| 287 | |
| 288 | func newSourceRepo(url, branch string) *platformv1alpha1.SourceRepository { |
| 289 | return &platformv1alpha1.SourceRepository{ |
no test coverage detected