MCPcopy Index your code
hub / github.com/nikivdev/go / getGitLocalConfig

Function getGitLocalConfig

cli/flow/main.go:4316–4331  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

4314}
4315
4316func getGitLocalConfig(key string) (string, error) {
4317 cmd := exec.Command("git", "config", "--local", "--get", key)
4318 out, err := cmd.CombinedOutput()
4319 if err != nil {
4320 var exitErr *exec.ExitError
4321 if errors.As(err, &exitErr) {
4322 return "", nil
4323 }
4324 trimmed := strings.TrimSpace(string(out))
4325 if trimmed != "" {
4326 return "", fmt.Errorf("git config --local --get %s: %s", key, trimmed)
4327 }
4328 return "", fmt.Errorf("git config --local --get %s: %w", key, err)
4329 }
4330 return strings.TrimSpace(string(out)), nil
4331}
4332
4333func setGitLocalConfig(key, value string) error {
4334 cmd := exec.Command("git", "config", "--local", key, value)

Callers 1

resolveGitMirrorRemoteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected