Skip to content

Commit 1233099

Browse files
authored
Merge pull request #798 from fcollonval/fcollonval/issue660
Display blank when simpleStaging is enabled
2 parents 03cb915 + f1690a2 commit 1233099

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

src/components/GitStage.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ export interface IGitStageProps {
4343
rowRenderer: (props: ListChildComponentProps) => JSX.Element;
4444
}
4545

46-
/**
47-
* Git stage component state
48-
*/
49-
export interface IGitStageState {
50-
showFiles: boolean;
51-
}
52-
5346
export const GitStage: React.FunctionComponent<IGitStageProps> = (
5447
props: IGitStageProps
5548
) => {

src/model.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,21 @@ export class GitExtension implements IGitExtension {
206206
return this._taskHandler.taskChanged;
207207
}
208208

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+
209224
/**
210225
* Add one or more files to the repository staging area.
211226
*
@@ -1119,12 +1134,9 @@ export class GitExtension implements IGitExtension {
11191134

11201135
/**
11211136
* Set the marker object for a repository path and branch.
1122-
*
1123-
* @returns branch marker
11241137
*/
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);
11281140
}
11291141

11301142
private _status: Git.IStatusFile[] = [];
@@ -1137,7 +1149,7 @@ export class GitExtension implements IGitExtension {
11371149
private _diffProviders: { [key: string]: Git.IDiffCallback } = {};
11381150
private _isDisposed = false;
11391151
private _markerCache: Markers = new Markers(() => this._markChanged.emit());
1140-
private _currentMarker: BranchMarker = null;
1152+
private __currentMarker: BranchMarker = null;
11411153
private _readyPromise: Promise<void> = Promise.resolve();
11421154
private _pendingReadyPromise = 0;
11431155
private _poll: Poll;

0 commit comments

Comments
 (0)