(key string)
| 4314 | } |
| 4315 | |
| 4316 | func 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 | |
| 4333 | func setGitLocalConfig(key, value string) error { |
| 4334 | cmd := exec.Command("git", "config", "--local", key, value) |
no outgoing calls
no test coverage detected