@@ -206,6 +206,21 @@ export class GitExtension implements IGitExtension {
206
206
return this . _taskHandler . taskChanged ;
207
207
}
208
208
209
+ /**
210
+ * Get the current markers
211
+ *
212
+ * Note: This makes sure it always returns non null value
213
+ */
214
+ protected get _currentMarker ( ) : BranchMarker {
215
+ if ( ! this . __currentMarker ) {
216
+ this . _setMarker (
217
+ this . pathRepository ,
218
+ this . _currentBranch ? this . _currentBranch . name : ''
219
+ ) ;
220
+ }
221
+ return this . __currentMarker ;
222
+ }
223
+
209
224
/**
210
225
* Add one or more files to the repository staging area.
211
226
*
@@ -1119,12 +1134,9 @@ export class GitExtension implements IGitExtension {
1119
1134
1120
1135
/**
1121
1136
* Set the marker object for a repository path and branch.
1122
- *
1123
- * @returns branch marker
1124
1137
*/
1125
- private _setMarker ( path : string , branch : string ) : BranchMarker {
1126
- this . _currentMarker = this . _markerCache . get ( path , branch ) ;
1127
- return this . _currentMarker ;
1138
+ private _setMarker ( path : string , branch : string ) : void {
1139
+ this . __currentMarker = this . _markerCache . get ( path , branch ) ;
1128
1140
}
1129
1141
1130
1142
private _status : Git . IStatusFile [ ] = [ ] ;
@@ -1137,7 +1149,7 @@ export class GitExtension implements IGitExtension {
1137
1149
private _diffProviders : { [ key : string ] : Git . IDiffCallback } = { } ;
1138
1150
private _isDisposed = false ;
1139
1151
private _markerCache : Markers = new Markers ( ( ) => this . _markChanged . emit ( ) ) ;
1140
- private _currentMarker : BranchMarker = null ;
1152
+ private __currentMarker : BranchMarker = null ;
1141
1153
private _readyPromise : Promise < void > = Promise . resolve ( ) ;
1142
1154
private _pendingReadyPromise = 0 ;
1143
1155
private _poll : Poll ;
0 commit comments