Minor refactoring for readability in NewCmdFork's runE

This commit is contained in:
camille folch 2021-06-08 20:26:22 -03:00
parent 54b86c7093
commit 568f4e4ee0
No known key found for this signature in database
GPG key ID: F67AC3874B6D8FF1

View file

@ -89,18 +89,14 @@ Additional 'git clone' flags can be passed in by listing them after '--'.`,
if opts.RemoteName == "" {
return &cmdutil.FlagError{Err: errors.New("--remote-name cannot be blank")}
} else if !cmd.Flags().Changed("remote-name") {
opts.Rename = true // Any existing 'origin' will be renamed to upstream
}
if promptOk && !cmd.Flags().Changed("clone") {
opts.PromptClone = true
}
if promptOk && !cmd.Flags().Changed("remote") {
opts.PromptRemote = true
}
if !cmd.Flags().Changed("remote-name") {
opts.Rename = true
if promptOk {
// We can prompt for these if they were not specified.
opts.PromptClone = !cmd.Flags().Changed("clone")
opts.PromptRemote = !cmd.Flags().Changed("remote")
}
if runF != nil {