(override string)
| 4252 | } |
| 4253 | |
| 4254 | func resolveGitMirrorRemote(override string) (string, error) { |
| 4255 | remote := strings.TrimSpace(override) |
| 4256 | if remote == "" { |
| 4257 | configured, err := getGitLocalConfig("fgo.collabRemote") |
| 4258 | if err != nil { |
| 4259 | return "", err |
| 4260 | } |
| 4261 | remote = strings.TrimSpace(configured) |
| 4262 | } |
| 4263 | if remote == "" { |
| 4264 | if exists, _, err := gitRemoteState("myflow-i"); err == nil && exists { |
| 4265 | remote = "myflow-i" |
| 4266 | } |
| 4267 | } |
| 4268 | if remote == "" { |
| 4269 | return "", fmt.Errorf("mirror remote not configured; run `%s gitMirror setup --remote myflow-i --url <git-url>`", commandName) |
| 4270 | } |
| 4271 | |
| 4272 | exists, _, err := gitRemoteState(remote) |
| 4273 | if err != nil { |
| 4274 | return "", err |
| 4275 | } |
| 4276 | if !exists { |
| 4277 | return "", fmt.Errorf("git remote %q not found", remote) |
| 4278 | } |
| 4279 | return remote, nil |
| 4280 | } |
| 4281 | |
| 4282 | func resolveGitMirrorBranch(override string) (string, error) { |
| 4283 | branch := strings.TrimSpace(override) |
no test coverage detected