Adds compare options to repository history

Adds compare options to file history
Fixes issue with repository history compare with commits with multiple files
This commit is contained in:
Eric Amodio
2016-11-25 14:12:39 -05:00
parent a91afffbb2
commit 615485cd21
5 changed files with 121 additions and 53 deletions

View File

@@ -351,7 +351,7 @@ export default class GitProvider extends Disposable {
Logger.log(`getLogForRepo('${repoPath}')`);
try {
const data = await Git.logRepo(repoPath);
return new GitLogParserEnricher().enrich(data, repoPath);
return new GitLogParserEnricher().enrich(data, repoPath, true);
}
catch (ex) {
return undefined;
@@ -529,7 +529,7 @@ export class GitUri extends Uri {
repoPath?: string | undefined;
sha?: string | undefined;
constructor(uri?: Uri) {
constructor(uri?: Uri, commit?: GitCommit) {
super();
if (!uri) return;
@@ -549,12 +549,22 @@ export class GitUri extends Uri {
this.repoPath = data.repoPath;
this.sha = data.sha;
}
else if (commit) {
base._fsPath = commit.originalFileName || commit.fileName;
this.repoPath = commit.repoPath;
this.sha = commit.sha;
}
}
fileUri() {
return Uri.file(this.fsPath);
}
static fromCommit(uri: Uri, commit: GitCommit) {
return new GitUri(uri, commit);
}
static fromUri(uri: Uri) {
return new GitUri(uri);
}