Pārlūkot izejas kodu

Fixes #252 - this.children reset because of await

main
Eric Amodio pirms 6 gadiem
vecāks
revīzija
0bec73ad8a
2 mainītis faili ar 7 papildinājumiem un 5 dzēšanām
  1. +1
    -0
      CHANGELOG.md
  2. +6
    -5
      src/views/nodes/statusNode.ts

+ 1
- 0
CHANGELOG.md Parādīt failu

@ -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 Parādīt failu

@ -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;
}

Notiek ielāde…
Atcelt
Saglabāt