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

Function TestGitShimAllowsReadonlyAccess

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

Source from the content-addressed store, hash-verified

130}
131
132func TestGitShimAllowsReadonlyAccess(t *testing.T) {
133 tempDir := initGitForPreCommit(t)
134 tempDir.MkdirAll(".quickhook", "pre-commit")
135 tempDir.WriteFile([]string{".quickhook", "pre-commit", "accesses-git"}, "#!/bin/sh \n git status")
136
137 output, err := tempDir.ExecQuickhook("hook", "pre-commit")
138 assert.Nil(t, err)
139 assert.Empty(t, output)
140}
141
142func TestGitShimDeniesOtherAccess(t *testing.T) {
143 tempDir := initGitForPreCommit(t)

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected