@@ -68,6 +68,7 @@ import {
6868 OpenChangedFilesCommandQuickPickItem ,
6969 OpenRemoteResourceCommandQuickPickItem ,
7070 ReferencesQuickPickItem ,
71+ RefQuickPickItem ,
7172 RepositoryQuickPickItem ,
7273 RevealInSideBarQuickPickItem ,
7374 SearchForCommitQuickPickItem ,
@@ -255,7 +256,7 @@ export async function getBranchesAndOrTags(
255256 ] ) ;
256257}
257258
258- export function getValidateGitReferenceFn ( repos : Repository | Repository [ ] ) {
259+ export function getValidateGitReferenceFn ( repos : Repository | Repository [ ] , options ?: { ranges ?: boolean } ) {
259260 return async ( quickpick : QuickPick < any > , value : string ) => {
260261 let inRefMode = false ;
261262 if ( value . startsWith ( '#' ) ) {
@@ -269,6 +270,13 @@ export function getValidateGitReferenceFn(repos: Repository | Repository[]) {
269270 repos = repos [ 0 ] ;
270271 }
271272
273+ if ( inRefMode && options ?. ranges && GitRevision . isRange ( value ) ) {
274+ quickpick . items = [
275+ RefQuickPickItem . create ( value , repos . path , true , { alwaysShow : true , ref : false , icon : false } ) ,
276+ ] ;
277+ return true ;
278+ }
279+
272280 if ( ! ( await Container . git . validateReference ( repos . path , value ) ) ) {
273281 if ( inRefMode ) {
274282 quickpick . items = [
@@ -510,13 +518,15 @@ export async function* pickBranchOrTagStep<
510518 titleContext,
511519 value,
512520 additionalButtons,
521+ ranges,
513522 } : {
514523 filter ?: { branches ?: ( b : GitBranch ) => boolean ; tags ?: ( t : GitTag ) => boolean } ;
515524 picked : string | string [ ] | undefined ;
516525 placeholder : string | ( ( context : Context ) => string ) ;
517526 titleContext ?: string ;
518527 value : string | undefined ;
519528 additionalButtons ?: QuickInputButton [ ] ;
529+ ranges ?: boolean ;
520530 } ,
521531) : StepResultGenerator < GitReference > {
522532 context . showTags = true ;
@@ -606,7 +616,7 @@ export async function* pickBranchOrTagStep<
606616 void GitActions . Commit . reveal ( item , { select : true , focus : false , expand : true } ) ;
607617 }
608618 } ,
609- onValidateValue : getValidateGitReferenceFn ( state . repo ) ,
619+ onValidateValue : getValidateGitReferenceFn ( state . repo , { ranges : ranges } ) ,
610620 } ) ;
611621 const selection : StepSelection < typeof step > = yield step ;
612622 return QuickCommand . canPickStepContinue ( step , state , selection ) ? selection [ 0 ] . item : StepResult . Break ;
0 commit comments