(t *testing.T)
| 103 | } |
| 104 | |
| 105 | func TestPassesWithNoFilesToBeCommitted(t *testing.T) { |
| 106 | tempDir := initGitForPreCommit(t) |
| 107 | tempDir.MkdirAll(".quickhook", "pre-commit") |
| 108 | tempDir.WriteFile([]string{".quickhook", "pre-commit", "passes"}, "#!/bin/sh \n echo \"passed\"") |
| 109 | tempDir.RequireExec("git", "commit", "--message", "Commit example.txt", "--quiet", "--no-verify") |
| 110 | |
| 111 | output, err := tempDir.ExecQuickhook("hook", "pre-commit") |
| 112 | assert.NoError(t, err) |
| 113 | assert.Equal(t, "", output) |
| 114 | } |
| 115 | |
| 116 | func TestHandlesDeletedFiles(t *testing.T) { |
| 117 | tempDir := initGitForPreCommit(t) |
nothing calls this directly
no test coverage detected