MCPcopy
hub / github.com/nektos/act / cleanGitHooks

Function cleanGitHooks

pkg/common/git/git_test.go:55–74  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

53}
54
55func cleanGitHooks(dir string) error {
56 hooksDir := filepath.Join(dir, ".git", "hooks")
57 files, err := os.ReadDir(hooksDir)
58 if err != nil {
59 if os.IsNotExist(err) {
60 return nil
61 }
62 return err
63 }
64 for _, f := range files {
65 if f.IsDir() {
66 continue
67 }
68 relName := filepath.Join(hooksDir, f.Name())
69 if err := os.Remove(relName); err != nil {
70 return err
71 }
72 }
73 return nil
74}
75
76func TestFindGitRemoteURL(t *testing.T) {
77 assert := assert.New(t)

Callers 2

TestFindGitRemoteURLFunction · 0.85
TestGitFindRefFunction · 0.85

Calls 3

IsDirMethod · 0.80
NameMethod · 0.80
RemoveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…