@@ -102,25 +102,25 @@ export class GutterChangesAnnotationProvider extends AnnotationProviderBase<Chan
102102 override async onProvideAnnotation ( context ?: ChangesAnnotationContext , state ?: AnnotationState ) : Promise < boolean > {
103103 const scope = getLogScope ( ) ;
104104
105- let ref1 = this . trackedDocument . uri . sha ;
106- let ref2 = context ?. sha != null && context . sha !== ref1 ? `${ context . sha } ^` : undefined ;
105+ let rev1 = this . trackedDocument . uri . sha ;
106+ let rev2 = context ?. sha != null && context . sha !== rev1 ? `${ context . sha } ^` : undefined ;
107107
108108 let commit : GitCommit | undefined ;
109109
110110 const commitsProvider = this . container . git . commits ( this . trackedDocument . uri . repoPath ! ) ;
111111
112- let localChanges = ref1 == null && ref2 == null ;
112+ let localChanges = rev1 == null && rev2 == null ;
113113 if ( localChanges ) {
114- let ref = await commitsProvider . getOldestUnpushedRefForFile ( this . trackedDocument . uri ) ;
115- if ( ref != null ) {
116- ref = `${ ref } ^` ;
117- commit = await commitsProvider . getCommitForFile ( this . trackedDocument . uri , { ref : ref } ) ;
114+ let rev = await commitsProvider . getOldestUnpushedShaForFile ( this . trackedDocument . uri ) ;
115+ if ( rev != null ) {
116+ rev = `${ rev } ^` ;
117+ commit = await commitsProvider . getCommitForFile ( this . trackedDocument . uri , rev ) ;
118118 if ( commit != null ) {
119- if ( ref2 != null ) {
120- ref2 = ref ;
119+ if ( rev2 != null ) {
120+ rev2 = rev ;
121121 } else {
122- ref1 = ref ;
123- ref2 = '' ;
122+ rev1 = rev ;
123+ rev2 = '' ;
124124 }
125125 } else {
126126 localChanges = false ;
@@ -135,40 +135,40 @@ export class GutterChangesAnnotationProvider extends AnnotationProviderBase<Chan
135135 ) ;
136136 if ( commits ?. length ) {
137137 commit = await commitsProvider . getCommitForFile ( this . trackedDocument . uri ) ;
138- ref1 = 'HEAD' ;
138+ rev1 = 'HEAD' ;
139139 } else if ( this . trackedDocument . dirty ) {
140- ref1 = 'HEAD' ;
140+ rev1 = 'HEAD' ;
141141 } else {
142142 localChanges = false ;
143143 }
144144 }
145145 }
146146
147147 if ( ! localChanges ) {
148- commit = await commitsProvider . getCommitForFile ( this . trackedDocument . uri , { ref : ref2 ?? ref1 } ) ;
148+ commit = await commitsProvider . getCommitForFile ( this . trackedDocument . uri , rev2 ?? rev1 ) ;
149149
150150 if ( commit != null ) {
151- if ( ref2 != null ) {
152- ref2 = commit . ref ;
151+ if ( rev2 != null ) {
152+ rev2 = commit . ref ;
153153 } else {
154- ref1 = `${ commit . ref } ^` ;
155- ref2 = commit . ref ;
154+ rev1 = `${ commit . ref } ^` ;
155+ rev2 = commit . ref ;
156156 }
157157 }
158158 }
159159
160160 const diffs = (
161161 await Promise . allSettled (
162- ref2 == null && this . editor . document . isDirty
162+ rev2 == null && this . editor . document . isDirty
163163 ? [
164164 this . container . git . getDiffForFileContents (
165165 this . trackedDocument . uri ,
166- ref1 ! ,
166+ rev1 ! ,
167167 this . editor . document . getText ( ) ,
168168 ) ,
169- this . container . git . getDiffForFile ( this . trackedDocument . uri , ref1 , ref2 ) ,
169+ this . container . git . getDiffForFile ( this . trackedDocument . uri , rev1 , rev2 ) ,
170170 ]
171- : [ this . container . git . getDiffForFile ( this . trackedDocument . uri , ref1 , ref2 ) ] ,
171+ : [ this . container . git . getDiffForFile ( this . trackedDocument . uri , rev1 , rev2 ) ] ,
172172 )
173173 )
174174 . map ( d => getSettledValue ( d ) )
0 commit comments