Minor refactoring for readability in NewCmdFork's runE
This commit is contained in:
parent
54b86c7093
commit
568f4e4ee0
1 changed files with 6 additions and 10 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue