@@ -38,7 +38,7 @@ interface State {
3838 reference : GitReference ;
3939 createBranch ?: string ;
4040 fastForwardTo ?: GitReference ;
41- skipWorktreeConfirmations ?: boolean ;
41+ worktreeDefaultOpen ?: 'new' | 'current' ;
4242}
4343
4444type ConfirmationChoice =
@@ -223,7 +223,7 @@ export class SwitchGitCommand extends QuickCommand<State> {
223223 openOnly : true ,
224224 overrides : {
225225 disallowBack : true ,
226- confirmation : state . skipWorktreeConfirmations
226+ confirmation : state . worktreeDefaultOpen
227227 ? undefined
228228 : {
229229 title : `Confirm Switch to Worktree \u2022 ${ getReferenceLabel (
@@ -241,12 +241,12 @@ export class SwitchGitCommand extends QuickCommand<State> {
241241 } ,
242242 onWorkspaceChanging : state . onWorkspaceChanging ,
243243 repo : state . repos [ 0 ] ,
244- skipWorktreeConfirmations : state . skipWorktreeConfirmations ,
244+ worktreeDefaultOpen : state . worktreeDefaultOpen ,
245245 } ,
246246 } ,
247247 this . pickedVia ,
248248 ) ;
249- if ( worktreeResult === StepResultBreak && ! state . skipWorktreeConfirmations ) continue ;
249+ if ( worktreeResult === StepResultBreak && ! state . worktreeDefaultOpen ) continue ;
250250
251251 endSteps ( state ) ;
252252 return ;
@@ -263,7 +263,7 @@ export class SwitchGitCommand extends QuickCommand<State> {
263263
264264 state . createBranch = undefined ;
265265 context . promptToCreateBranch = false ;
266- if ( state . skipWorktreeConfirmations ) {
266+ if ( state . worktreeDefaultOpen ) {
267267 state . reference = context . canSwitchToLocalBranch ;
268268 continue outer;
269269 }
@@ -273,7 +273,7 @@ export class SwitchGitCommand extends QuickCommand<State> {
273273 }
274274
275275 if (
276- state . skipWorktreeConfirmations ||
276+ state . worktreeDefaultOpen ||
277277 this . confirm ( context . promptToCreateBranch || context . canSwitchToLocalBranch ? true : state . confirm )
278278 ) {
279279 const result = yield * this . confirmStep ( state as SwitchStepState , context ) ;
@@ -330,12 +330,12 @@ export class SwitchGitCommand extends QuickCommand<State> {
330330 result === 'switchToNewBranchViaWorktree' ? state . createBranch : undefined ,
331331 repo : state . repos [ 0 ] ,
332332 onWorkspaceChanging : state . onWorkspaceChanging ,
333- skipWorktreeConfirmations : state . skipWorktreeConfirmations ,
333+ worktreeDefaultOpen : state . worktreeDefaultOpen ,
334334 } ,
335335 } ,
336336 this . pickedVia ,
337337 ) ;
338- if ( worktreeResult === StepResultBreak && ! state . skipWorktreeConfirmations ) continue outer;
338+ if ( worktreeResult === StepResultBreak && ! state . worktreeDefaultOpen ) continue outer;
339339
340340 endSteps ( state ) ;
341341 return ;
@@ -355,7 +355,7 @@ export class SwitchGitCommand extends QuickCommand<State> {
355355 const isRemoteBranch = isBranchReference ( state . reference ) && state . reference . remote ;
356356
357357 type StepType = QuickPickItemOfT < ConfirmationChoice > ;
358- if ( state . skipWorktreeConfirmations && state . repos . length === 1 ) {
358+ if ( state . worktreeDefaultOpen && state . repos . length === 1 ) {
359359 if ( isLocalBranch ) {
360360 return 'switchViaWorktree' ;
361361 } else if ( ! state . createBranch && context . canSwitchToLocalBranch != null ) {
0 commit comments