Adds a file history explorer view

This commit is contained in:
Eric Amodio
2017-08-27 04:22:49 -04:00
parent ef41176ea7
commit 480dcb95fb
8 changed files with 263 additions and 9 deletions

View File

@@ -14,11 +14,11 @@ export class FileHistoryNode extends ExplorerNode {
super(uri);
}
async getChildren(): Promise<CommitNode[]> {
async getChildren(): Promise<ExplorerNode[]> {
const log = await this.git.getLogForFile(this.uri.repoPath, this.uri.fsPath, this.uri.sha);
if (log === undefined) return [];
if (log === undefined) return [new TextExplorerNode('No file history')];
return [...Iterables.map(log.commits.values(), c => new CommitNode(c, this.git.config.gitExplorer.commitFormat, this.context, this.git))];
return [...Iterables.map(log.commits.values(), c => new CommitNode(c, this.git.config.fileHistoryExplorer.commitFormat, this.context, this.git))];
}
getTreeItem(): TreeItem {