mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-19 01:35:37 -05:00
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:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user