@@ -29,7 +29,7 @@ import type { Issue, IssueShape, SearchedIssue } from '../../git/models/issue';
2929import { getOrOpenIssueRepository } from '../../git/models/issue' ;
3030import type { Repository } from '../../git/models/repository' ;
3131import type { QuickPickItemOfT } from '../../quickpicks/items/common' ;
32- import { createQuickPickItemOfT , createQuickPickSeparator } from '../../quickpicks/items/common' ;
32+ import { createQuickPickItemOfT } from '../../quickpicks/items/common' ;
3333import type { DirectiveQuickPickItem } from '../../quickpicks/items/directive' ;
3434import { createDirectiveQuickPickItem , Directive } from '../../quickpicks/items/directive' ;
3535import { getScopedCounter } from '../../system/counter' ;
@@ -54,14 +54,13 @@ interface Context {
5454interface State {
5555 item ?: StartWorkItem ;
5656 type ?: StartWorkType ;
57- inWorktree ?: boolean ;
5857}
5958interface StateWithType extends State {
6059 type : StartWorkType ;
6160}
6261
63- export type StartWorkType = 'branch' | 'branch-worktree' | ' issue' | 'issue-worktree ';
64- type StartWorkTypeItem = { type : StartWorkType ; inWorktree ?: boolean } ;
62+ export type StartWorkType = 'branch' | 'issue' ;
63+ type StartWorkTypeItem = { type : StartWorkType } ;
6564
6665export interface StartWorkCommandArgs {
6766 readonly command : 'startWork' ;
@@ -125,7 +124,6 @@ export class StartWorkCommand extends QuickCommand<State> {
125124 const result = yield * this . selectTypeStep ( state ) ;
126125 if ( result === StepResultBreak ) continue ;
127126 state . type = result . type ;
128- state . inWorktree = result . inWorktree ;
129127 if ( this . container . telemetry . enabled ) {
130128 this . container . telemetry . sendEvent (
131129 'startWork/type/chosen' ,
@@ -139,7 +137,7 @@ export class StartWorkCommand extends QuickCommand<State> {
139137 }
140138 }
141139
142- if ( ( state . counter < 2 && state . type === 'issue' ) || state . type === 'issue-worktree ') {
140+ if ( state . counter < 2 && state . type === 'issue' ) {
143141 if ( ! hasConnectedIntegrations ) {
144142 if ( this . container . telemetry . enabled ) {
145143 this . container . telemetry . sendEvent (
@@ -189,7 +187,6 @@ export class StartWorkCommand extends QuickCommand<State> {
189187 }
190188 } else {
191189 state . type = result . type ;
192- state . inWorktree = result . inWorktree ;
193190 }
194191 }
195192
@@ -206,9 +203,8 @@ export class StartWorkCommand extends QuickCommand<State> {
206203 name : issue ? `${ slug ( issue . id , { lower : false } ) } -${ slug ( issue . title ) } ` : undefined ,
207204 suggestNameOnly : true ,
208205 suggestRepoOnly : true ,
209- flags : state . inWorktree ? [ '--worktree' ] : [ '--switch ' ] ,
206+ confirmOptions : [ '--switch' , '--worktree ' ] ,
210207 } ,
211- confirm : false ,
212208 } ,
213209 this . pickedVia ,
214210 ) ;
@@ -222,47 +218,23 @@ export class StartWorkCommand extends QuickCommand<State> {
222218 return state . counter < 0 ? StepResultBreak : undefined ;
223219 }
224220
225- private * selectTypeStep (
226- state : StepState < State > ,
227- ) : StepResultGenerator < { type : StartWorkType ; inWorktree ?: boolean } > {
221+ private * selectTypeStep ( state : StepState < State > ) : StepResultGenerator < { type : StartWorkType } > {
228222 const step = createPickStep ( {
229223 placeholder : 'Choose how to start work' ,
230224 items : [
231- createQuickPickSeparator ( 'Issues' ) ,
232225 createQuickPickItemOfT < StartWorkTypeItem > (
233226 {
234227 label : 'Create Branch from Issue...' ,
235228 detail : 'Will create a new branch after selecting an issue' ,
236229 } ,
237230 { type : 'issue' } ,
238231 ) ,
239- createQuickPickItemOfT < StartWorkTypeItem > (
240- {
241- label : 'Create Branch & Worktree from Issue...' ,
242- detail : 'Will create a new branch & worktree after selecting an issue' ,
243- } ,
244- {
245- type : 'issue-worktree' ,
246- inWorktree : true ,
247- } ,
248- ) ,
249- createQuickPickSeparator ( 'References' ) ,
250232 createQuickPickItemOfT < StartWorkTypeItem > (
251233 { label : 'Create Branch...' , detail : 'Will create a new branch after selecting a reference' } ,
252234 {
253235 type : 'branch' ,
254236 } ,
255237 ) ,
256- createQuickPickItemOfT < StartWorkTypeItem > (
257- {
258- label : 'Create Branch & Worktree...' ,
259- detail : 'Will create a new branch & worktree after selecting a reference' ,
260- } ,
261- {
262- type : 'branch-worktree' ,
263- inWorktree : true ,
264- } ,
265- ) ,
266238 ] ,
267239 } ) ;
268240 const selection : StepSelection < typeof step > = yield step ;
@@ -444,12 +416,7 @@ export class StartWorkCommand extends QuickCommand<State> {
444416 if ( ! context . result . items . length ) {
445417 return {
446418 placeholder : 'No issues found. Start work anyway.' ,
447- items : [
448- createQuickPickItemOfT < StartWorkTypeItem > (
449- state . inWorktree ? 'Create a branch on a worktree' : 'Create a branch' ,
450- { type : state . inWorktree ? 'branch-worktree' : 'branch' , inWorktree : state . inWorktree } ,
451- ) ,
452- ] ,
419+ items : [ createQuickPickItemOfT < StartWorkTypeItem > ( 'Create a branch' , { type : 'branch' } ) ] ,
453420 } ;
454421 }
455422
0 commit comments