File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -300,16 +300,18 @@ func checkModifyPreconditions(cfg *config.Config) (*loadStackResult, error) {
300300
301301 // Ensure trunk branch exists locally (it may be absent if the user
302302 // renamed their initial branch before starting the stack).
303- remote , err := pickRemote (cfg , result .CurrentBranch , "" )
304- if err != nil {
305- if ! errors .Is (err , errInterrupt ) {
306- cfg .Errorf ("failed to resolve remote: %s" , err )
303+ if ! git .BranchExists (s .Trunk .Branch ) {
304+ remote , err := pickRemote (cfg , result .CurrentBranch , "" )
305+ if err != nil {
306+ if ! errors .Is (err , errInterrupt ) {
307+ cfg .Errorf ("failed to resolve remote: %s" , err )
308+ }
309+ return nil , ErrSilent
310+ }
311+ if err := ensureLocalTrunk (cfg , s .Trunk .Branch , remote ); err != nil {
312+ cfg .Errorf ("%s" , err )
313+ return nil , ErrSilent
307314 }
308- return nil , ErrSilent
309- }
310- if err := ensureLocalTrunk (cfg , s .Trunk .Branch , remote ); err != nil {
311- cfg .Errorf ("%s" , err )
312- return nil , ErrSilent
313315 }
314316
315317 // Show loading indicator while syncing PRs
You can’t perform that action at this time.
0 commit comments