MCPcopy Create free account
hub / github.com/dirk/quickhook / TestPassesWithNoFilesToBeCommitted

Function TestPassesWithNoFilesToBeCommitted

hooks/pre_commit_test.go:105–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func 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
116func TestHandlesDeletedFiles(t *testing.T) {
117 tempDir := initGitForPreCommit(t)

Callers

nothing calls this directly

Calls 5

initGitForPreCommitFunction · 0.85
MkdirAllMethod · 0.80
WriteFileMethod · 0.80
RequireExecMethod · 0.80
ExecQuickhookMethod · 0.80

Tested by

no test coverage detected