(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func initGitForPreCommit(t *testing.T) test.TempDir { |
| 18 | tempDir := test.NewTempDir(t, 1) |
| 19 | tempDir.RequireExec("git", "init", "--initial-branch=main", "--quiet", ".") |
| 20 | tempDir.RequireExec("git", "config", "--local", "user.name", "example") |
| 21 | tempDir.RequireExec("git", "config", "--local", "user.email", "example@example.com") |
| 22 | tempDir.WriteFile([]string{"example.txt"}, "Changed!") |
| 23 | tempDir.RequireExec("git", "add", "example.txt") |
| 24 | return tempDir |
| 25 | } |
| 26 | |
| 27 | func TestFailingHookWithoutPty(t *testing.T) { |
| 28 | tempDir := initGitForPreCommit(t) |
no test coverage detected