Explorar el Código

Fixes #252 - this.children reset because of await

main
Eric Amodio hace 6 años
padre
commit
0bec73ad8a
Se han modificado 2 ficheros con 7 adiciones y 5 borrados
  1. +1
    -0
      CHANGELOG.md
  2. +6
    -5
      src/views/nodes/statusNode.ts

+ 1
- 0
CHANGELOG.md Ver fichero

@ -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 Ver fichero

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

Cargando…
Cancelar
Guardar