MCPcopy Index your code
hub / github.com/conventionalcommit/commitlint / getGitHookConfig

Function getGitHookConfig

internal/cmd/debug.go:79–101  ·  view source on GitHub ↗
(isGlobal bool)

Source from the content-addressed store, hash-verified

77}
78
79func getGitHookConfig(isGlobal bool) (string, error) {
80 b := &bytes.Buffer{}
81
82 var args = []string{"config"}
83 if isGlobal {
84 args = append(args, "--global")
85 }
86 args = append(args, "core.hooksPath")
87
88 cmd := exec.Command("git", args...)
89 cmd.Stderr = os.Stderr
90 cmd.Stdout = b
91
92 err := cmd.Run()
93 if err != nil {
94 return "", err
95 }
96
97 s := strings.TrimSpace(b.String())
98 s = strings.Trim(s, "\n")
99
100 return s, nil
101}

Callers 1

printDebugFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected