File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -89,18 +89,14 @@ Additional 'git clone' flags can be passed in by listing them after '--'.`,
8989
9090 if opts .RemoteName == "" {
9191 return & cmdutil.FlagError {Err : errors .New ("--remote-name cannot be blank" )}
92+ } else if ! cmd .Flags ().Changed ("remote-name" ) {
93+ opts .Rename = true // Any existing 'origin' will be renamed to upstream
9294 }
9395
94- if promptOk && ! cmd .Flags ().Changed ("clone" ) {
95- opts .PromptClone = true
96- }
97-
98- if promptOk && ! cmd .Flags ().Changed ("remote" ) {
99- opts .PromptRemote = true
100- }
101-
102- if ! cmd .Flags ().Changed ("remote-name" ) {
103- opts .Rename = true
96+ if promptOk {
97+ // We can prompt for these if they were not specified.
98+ opts .PromptClone = ! cmd .Flags ().Changed ("clone" )
99+ opts .PromptRemote = ! cmd .Flags ().Changed ("remote" )
104100 }
105101
106102 if runF != nil {
You can’t perform that action at this time.
0 commit comments