(key string, defaultValue string)
| 114 | } |
| 115 | |
| 116 | func (repo *Repository) ConfigStringDefault(key string, defaultValue string) (string, error) { |
| 117 | cmd := repo.GitCommand( |
| 118 | "config", |
| 119 | "--default", defaultValue, |
| 120 | key, |
| 121 | ) |
| 122 | |
| 123 | out, err := cmd.Output() |
| 124 | if err != nil { |
| 125 | return defaultValue, fmt.Errorf("running 'git config': %w", err) |
| 126 | } |
| 127 | |
| 128 | if len(out) > 0 && out[len(out)-1] == '\n' { |
| 129 | out = out[:len(out)-1] |
| 130 | } |
| 131 | |
| 132 | return string(out), nil |
| 133 | } |
| 134 | |
| 135 | func (repo *Repository) ConfigBoolDefault(key string, defaultValue bool) (bool, error) { |
| 136 | cmd := repo.GitCommand( |
no test coverage detected