initBareRepo creates an empty (unborn) git repository with identity configured but no commits, returning the repo dir.
(t *testing.T)
| 28 | // initBareRepo creates an empty (unborn) git repository with identity configured |
| 29 | // but no commits, returning the repo dir. |
| 30 | func initBareRepo(t *testing.T) string { |
| 31 | t.Helper() |
| 32 | repo := t.TempDir() |
| 33 | runGitTest(t, repo, "init", "-q") |
| 34 | runGitTest(t, repo, "config", "user.email", "test@example.com") |
| 35 | runGitTest(t, repo, "config", "user.name", "Test User") |
| 36 | runGitTest(t, repo, "config", "commit.gpgsign", "false") |
| 37 | return repo |
| 38 | } |
| 39 | |
| 40 | // writeCommit writes content to name, stages it, and commits with msg. |
| 41 | func writeCommit(t *testing.T, repo, name, content, msg string) { |
no test coverage detected