Skip to content

Commit c5f5717

Browse files
committed
Fixes issue where work tree files could no show up
1 parent dd0a636 commit c5f5717

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/views/statusFilesNode.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,18 @@ export class StatusFilesNode extends ExplorerNode {
2222
}
2323

2424
async getChildren(): Promise<ExplorerNode[]> {
25-
let statuses: IGitStatusFileWithCommit[];
25+
let statuses: IGitStatusFileWithCommit[] = [];
26+
2627
let log: GitLog | undefined;
2728
if (this.range !== undefined) {
2829
log = await this.git.getLogForRepo(this.status.repoPath, this.range, this.maxCount);
29-
if (log === undefined) return [];
30-
31-
statuses = Array.from(Iterables.flatMap(log.commits.values(), c => {
32-
return c.fileStatuses.map(s => {
33-
return { ...s, commit: c } as IGitStatusFileWithCommit;
34-
});
35-
}));
36-
}
37-
else {
38-
statuses = [];
30+
if (log !== undefined) {
31+
statuses = Array.from(Iterables.flatMap(log.commits.values(), c => {
32+
return c.fileStatuses.map(s => {
33+
return { ...s, commit: c } as IGitStatusFileWithCommit;
34+
});
35+
}));
36+
}
3937
}
4038

4139
if (this.status.files.length !== 0 && this.includeWorkingTree) {

0 commit comments

Comments
 (0)