Skip to content

Commit

Permalink
Fixes issue where work tree files could no show up
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Sep 24, 2017
1 parent dd0a636 commit c5f5717
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/views/statusFilesNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,18 @@ export class StatusFilesNode extends ExplorerNode {
}

async getChildren(): Promise<ExplorerNode[]> {
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) {
Expand Down

0 comments on commit c5f5717

Please sign in to comment.