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

Function resolveGitMirrorRemote

cli/flow/main.go:4254–4280  ·  view source on GitHub ↗
(override string)

Source from the content-addressed store, hash-verified

4252}
4253
4254func 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
4282func resolveGitMirrorBranch(override string) (string, error) {
4283 branch := strings.TrimSpace(override)

Callers 3

runGitMirrorPushFunction · 0.85
runGitMirrorPullFunction · 0.85
runGitMirrorTakeFunction · 0.85

Calls 2

getGitLocalConfigFunction · 0.85
gitRemoteStateFunction · 0.85

Tested by

no test coverage detected