Преглед на файлове

Fixes #252 - this.children reset because of await

main
Eric Amodio преди 6 години
родител
ревизия
0bec73ad8a
променени са 2 файла, в които са добавени 7 реда и са изтрити 5 реда
  1. +1
    -0
      CHANGELOG.md
  2. +6
    -5
      src/views/nodes/statusNode.ts

+ 1
- 0
CHANGELOG.md Целия файл

@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#444](https://github.com/eamodio/vscode-gitlens/issues/444) - GitLens custom viewlet icon slightly larger than standard
- Fixes [#437](https://github.com/eamodio/vscode-gitlens/issues/437) - Remove --first-parent from git commands to show file history from merged in repositories
- Fixes [#252](https://github.com/eamodio/vscode-gitlens/issues/252) - Cannot read property 'push' of undefined
- Fixes issue where GitLens saves a couple settings with default values into user settings (rather than just removing the setting)
## [8.5.0] - 2018-07-16

+ 6
- 5
src/views/nodes/statusNode.ts Целия файл

@ -25,21 +25,21 @@ export class StatusNode extends ExplorerNode {
async getChildren(): Promise<ExplorerNode[]> {
this.resetChildren();
this.children = [];
const children = [];
const status = await this.repo.getStatus();
if (status !== undefined) {
if (status.state.behind) {
this.children.push(new StatusUpstreamNode(status, 'behind', this.explorer, this.active));
children.push(new StatusUpstreamNode(status, 'behind', this.explorer, this.active));
}
if (status.state.ahead) {
this.children.push(new StatusUpstreamNode(status, 'ahead', this.explorer, this.active));
children.push(new StatusUpstreamNode(status, 'ahead', this.explorer, this.active));
}
if (status.state.ahead || (status.files.length !== 0 && this.includeWorkingTree)) {
const range = status.upstream ? `${status.upstream}..${status.branch}` : undefined;
this.children.push(new StatusFilesNode(status, range, this.explorer, this.active));
children.push(new StatusFilesNode(status, range, this.explorer, this.active));
}
}
@ -57,9 +57,10 @@ export class StatusNode extends ExplorerNode {
);
}
this.children.push(new StatusBranchNode(branch, this.uri, this.explorer));
children.push(new StatusBranchNode(branch, this.uri, this.explorer));
}
this.children = children;
return this.children;
}

Зареждане…
Отказ
Запис