From c5f57172e4095c8f7196f24917030c5f6dd90e8e Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sat, 23 Sep 2017 23:36:43 -0400 Subject: [PATCH] Fixes issue where work tree files could no show up --- src/views/statusFilesNode.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/views/statusFilesNode.ts b/src/views/statusFilesNode.ts index 6de7780..8c71ec0 100644 --- a/src/views/statusFilesNode.ts +++ b/src/views/statusFilesNode.ts @@ -22,20 +22,18 @@ export class StatusFilesNode extends ExplorerNode { } async getChildren(): Promise { - let statuses: IGitStatusFileWithCommit[]; + let statuses: IGitStatusFileWithCommit[] = []; + let log: GitLog | undefined; if (this.range !== undefined) { log = await this.git.getLogForRepo(this.status.repoPath, this.range, this.maxCount); - if (log === undefined) return []; - - statuses = Array.from(Iterables.flatMap(log.commits.values(), c => { - return c.fileStatuses.map(s => { - return { ...s, commit: c } as IGitStatusFileWithCommit; - }); - })); - } - else { - statuses = []; + if (log !== undefined) { + statuses = Array.from(Iterables.flatMap(log.commits.values(), c => { + return c.fileStatuses.map(s => { + return { ...s, commit: c } as IGitStatusFileWithCommit; + }); + })); + } } if (this.status.files.length !== 0 && this.includeWorkingTree) {