@@ -29,7 +29,7 @@ import type { Issue, IssueShape, SearchedIssue } from '../../git/models/issue';
29
29
import { getOrOpenIssueRepository } from '../../git/models/issue' ;
30
30
import type { Repository } from '../../git/models/repository' ;
31
31
import type { QuickPickItemOfT } from '../../quickpicks/items/common' ;
32
- import { createQuickPickItemOfT , createQuickPickSeparator } from '../../quickpicks/items/common' ;
32
+ import { createQuickPickItemOfT } from '../../quickpicks/items/common' ;
33
33
import type { DirectiveQuickPickItem } from '../../quickpicks/items/directive' ;
34
34
import { createDirectiveQuickPickItem , Directive } from '../../quickpicks/items/directive' ;
35
35
import { getScopedCounter } from '../../system/counter' ;
@@ -54,14 +54,13 @@ interface Context {
54
54
interface State {
55
55
item ?: StartWorkItem ;
56
56
type ?: StartWorkType ;
57
- inWorktree ?: boolean ;
58
57
}
59
58
interface StateWithType extends State {
60
59
type : StartWorkType ;
61
60
}
62
61
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 } ;
65
64
66
65
export interface StartWorkCommandArgs {
67
66
readonly command : 'startWork' ;
@@ -125,7 +124,6 @@ export class StartWorkCommand extends QuickCommand<State> {
125
124
const result = yield * this . selectTypeStep ( state ) ;
126
125
if ( result === StepResultBreak ) continue ;
127
126
state . type = result . type ;
128
- state . inWorktree = result . inWorktree ;
129
127
if ( this . container . telemetry . enabled ) {
130
128
this . container . telemetry . sendEvent (
131
129
'startWork/type/chosen' ,
@@ -139,7 +137,7 @@ export class StartWorkCommand extends QuickCommand<State> {
139
137
}
140
138
}
141
139
142
- if ( ( state . counter < 2 && state . type === 'issue' ) || state . type === 'issue-worktree ') {
140
+ if ( state . counter < 2 && state . type === 'issue' ) {
143
141
if ( ! hasConnectedIntegrations ) {
144
142
if ( this . container . telemetry . enabled ) {
145
143
this . container . telemetry . sendEvent (
@@ -189,7 +187,6 @@ export class StartWorkCommand extends QuickCommand<State> {
189
187
}
190
188
} else {
191
189
state . type = result . type ;
192
- state . inWorktree = result . inWorktree ;
193
190
}
194
191
}
195
192
@@ -206,9 +203,8 @@ export class StartWorkCommand extends QuickCommand<State> {
206
203
name : issue ? `${ slug ( issue . id , { lower : false } ) } -${ slug ( issue . title ) } ` : undefined ,
207
204
suggestNameOnly : true ,
208
205
suggestRepoOnly : true ,
209
- flags : state . inWorktree ? [ '--worktree' ] : [ '--switch ' ] ,
206
+ confirmOptions : [ '--switch' , '--worktree ' ] ,
210
207
} ,
211
- confirm : false ,
212
208
} ,
213
209
this . pickedVia ,
214
210
) ;
@@ -222,47 +218,23 @@ export class StartWorkCommand extends QuickCommand<State> {
222
218
return state . counter < 0 ? StepResultBreak : undefined ;
223
219
}
224
220
225
- private * selectTypeStep (
226
- state : StepState < State > ,
227
- ) : StepResultGenerator < { type : StartWorkType ; inWorktree ?: boolean } > {
221
+ private * selectTypeStep ( state : StepState < State > ) : StepResultGenerator < { type : StartWorkType } > {
228
222
const step = createPickStep ( {
229
223
placeholder : 'Choose how to start work' ,
230
224
items : [
231
- createQuickPickSeparator ( 'Issues' ) ,
232
225
createQuickPickItemOfT < StartWorkTypeItem > (
233
226
{
234
227
label : 'Create Branch from Issue...' ,
235
228
detail : 'Will create a new branch after selecting an issue' ,
236
229
} ,
237
230
{ type : 'issue' } ,
238
231
) ,
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' ) ,
250
232
createQuickPickItemOfT < StartWorkTypeItem > (
251
233
{ label : 'Create Branch...' , detail : 'Will create a new branch after selecting a reference' } ,
252
234
{
253
235
type : 'branch' ,
254
236
} ,
255
237
) ,
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
- ) ,
266
238
] ,
267
239
} ) ;
268
240
const selection : StepSelection < typeof step > = yield step ;
@@ -444,12 +416,7 @@ export class StartWorkCommand extends QuickCommand<State> {
444
416
if ( ! context . result . items . length ) {
445
417
return {
446
418
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' } ) ] ,
453
420
} ;
454
421
}
455
422
0 commit comments