@@ -226,7 +226,7 @@ export class RebaseGitCommand extends QuickCommand<State> {
226
226
const title = `${ context . title } ${ getReferenceLabel ( state . destination , { icon : false , label : false } ) } ` ;
227
227
const ahead = counts != null ? counts . right : 0 ;
228
228
const behind = counts != null ? counts . left : 0 ;
229
- if ( behind === 0 ) {
229
+ if ( behind === 0 && ahead === 0 ) {
230
230
const step : QuickPickStep < DirectiveQuickPickItem > = this . createConfirmStep (
231
231
appendReposToTitle ( title , state , context ) ,
232
232
[ ] ,
@@ -248,9 +248,20 @@ export class RebaseGitCommand extends QuickCommand<State> {
248
248
return StepResultBreak ;
249
249
}
250
250
251
- const step : QuickPickStep < FlagsQuickPickItem < Flags > > = this . createConfirmStep (
252
- appendReposToTitle ( `Confirm ${ title } ` , state , context ) ,
253
- [
251
+ const rebaseItems = [
252
+ createFlagsQuickPickItem < Flags > ( state . flags , [ '--interactive' ] , {
253
+ label : `Interactive ${ this . title } ` ,
254
+ description : '--interactive' ,
255
+ detail : `Will interactively update ${ getReferenceLabel ( context . branch , {
256
+ label : false ,
257
+ } ) } by applying ${ pluralize ( 'commit' , ahead ) } on top of ${ getReferenceLabel ( state . destination , {
258
+ label : false ,
259
+ } ) } `,
260
+ } ) ,
261
+ ] ;
262
+
263
+ if ( behind > 0 ) {
264
+ rebaseItems . unshift (
254
265
createFlagsQuickPickItem < Flags > ( state . flags , [ ] , {
255
266
label : this . title ,
256
267
detail : `Will update ${ getReferenceLabel ( context . branch , {
@@ -259,16 +270,12 @@ export class RebaseGitCommand extends QuickCommand<State> {
259
270
label : false ,
260
271
} ) } `,
261
272
} ) ,
262
- createFlagsQuickPickItem < Flags > ( state . flags , [ '--interactive' ] , {
263
- label : `Interactive ${ this . title } ` ,
264
- description : '--interactive' ,
265
- detail : `Will interactively update ${ getReferenceLabel ( context . branch , {
266
- label : false ,
267
- } ) } by applying ${ pluralize ( 'commit' , ahead ) } on top of ${ getReferenceLabel ( state . destination , {
268
- label : false ,
269
- } ) } `,
270
- } ) ,
271
- ] ,
273
+ ) ;
274
+ }
275
+
276
+ const step : QuickPickStep < FlagsQuickPickItem < Flags > > = this . createConfirmStep (
277
+ appendReposToTitle ( `Confirm ${ title } ` , state , context ) ,
278
+ rebaseItems ,
272
279
) ;
273
280
const selection : StepSelection < typeof step > = yield step ;
274
281
return canPickStepContinue ( step , state , selection ) ? selection [ 0 ] . item : StepResultBreak ;
0 commit comments