Changes behavior of diffWithWorking to always does what it says

Compares the current file with the working tree -- if the current file *is* the working file, it will show a `File matches the working tree` message
This commit is contained in:
Eric Amodio
2017-05-27 04:26:51 -04:00
parent 365af9c54b
commit 53c691898f

View File

@@ -26,6 +26,8 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
if (args.commit === undefined || GitService.isUncommitted(args.commit.sha)) {
const gitUri = await GitUri.fromUri(uri, this.git);
// If the sha is missing, just let the user know the file matches
if (gitUri.sha === undefined) return window.showInformationMessage(`File matches the working tree`);
try {
args.commit = await this.git.getLogCommit(gitUri.repoPath, gitUri.fsPath, gitUri.sha, { firstIfMissing: true });