@@ -107,19 +107,14 @@ export class GutterChangesAnnotationProvider extends AnnotationProviderBase<Chan
107107
108108 let commit : GitCommit | undefined ;
109109
110+ const commitsProvider = this . container . git . commits ( this . trackedDocument . uri . repoPath ! ) ;
111+
110112 let localChanges = ref1 == null && ref2 == null ;
111113 if ( localChanges ) {
112- let ref = await this . container . git . getOldestUnpushedRefForFile (
113- this . trackedDocument . uri . repoPath ! ,
114- this . trackedDocument . uri ,
115- ) ;
114+ let ref = await commitsProvider . getOldestUnpushedRefForFile ( this . trackedDocument . uri ) ;
116115 if ( ref != null ) {
117116 ref = `${ ref } ^` ;
118- commit = await this . container . git . getCommitForFile (
119- this . trackedDocument . uri . repoPath ,
120- this . trackedDocument . uri ,
121- { ref : ref } ,
122- ) ;
117+ commit = await commitsProvider . getCommitForFile ( this . trackedDocument . uri , { ref : ref } ) ;
123118 if ( commit != null ) {
124119 if ( ref2 != null ) {
125120 ref2 = ref ;
@@ -139,10 +134,7 @@ export class GutterChangesAnnotationProvider extends AnnotationProviderBase<Chan
139134 await this . container . git . getCurrentUser ( this . trackedDocument . uri . repoPath ! ) ,
140135 ) ;
141136 if ( commits ?. length ) {
142- commit = await this . container . git . getCommitForFile (
143- this . trackedDocument . uri . repoPath ,
144- this . trackedDocument . uri ,
145- ) ;
137+ commit = await commitsProvider . getCommitForFile ( this . trackedDocument . uri ) ;
146138 ref1 = 'HEAD' ;
147139 } else if ( this . trackedDocument . dirty ) {
148140 ref1 = 'HEAD' ;
@@ -153,13 +145,7 @@ export class GutterChangesAnnotationProvider extends AnnotationProviderBase<Chan
153145 }
154146
155147 if ( ! localChanges ) {
156- commit = await this . container . git . getCommitForFile (
157- this . trackedDocument . uri . repoPath ,
158- this . trackedDocument . uri ,
159- {
160- ref : ref2 ?? ref1 ,
161- } ,
162- ) ;
148+ commit = await commitsProvider . getCommitForFile ( this . trackedDocument . uri , { ref : ref2 ?? ref1 } ) ;
163149
164150 if ( commit != null ) {
165151 if ( ref2 != null ) {
0 commit comments