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

Function getGitVersion

internal/cmd/debug.go:63–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61}
62
63func getGitVersion() (string, error) {
64 b := &bytes.Buffer{}
65
66 cmd := exec.Command("git", "version")
67 cmd.Stdout = b
68 cmd.Stderr = os.Stderr
69 err := cmd.Run()
70 if err != nil {
71 return "", err
72 }
73
74 ver := strings.ReplaceAll(b.String(), "git version ", "v")
75 ver = strings.Trim(ver, "\n")
76 return ver, nil
77}
78
79func getGitHookConfig(isGlobal bool) (string, error) {
80 b := &bytes.Buffer{}

Callers 1

printDebugFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected