| 4331 | } |
| 4332 | |
| 4333 | func setGitLocalConfig(key, value string) error { |
| 4334 | cmd := exec.Command("git", "config", "--local", key, value) |
| 4335 | out, err := cmd.CombinedOutput() |
| 4336 | if err != nil { |
| 4337 | trimmed := strings.TrimSpace(string(out)) |
| 4338 | if trimmed != "" { |
| 4339 | return fmt.Errorf("git config --local %s %s: %s", key, value, trimmed) |
| 4340 | } |
| 4341 | return fmt.Errorf("git config --local %s %s: %w", key, value, err) |
| 4342 | } |
| 4343 | return nil |
| 4344 | } |
| 4345 | |
| 4346 | func gitWorkingTreeDirty() (bool, error) { |
| 4347 | out, err := exec.Command("git", "status", "--porcelain").Output() |