Skip to content

Commit 53c6918

Browse files
committed
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
1 parent 365af9c commit 53c6918

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/commands/diffWithWorking.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
2626

2727
if (args.commit === undefined || GitService.isUncommitted(args.commit.sha)) {
2828
const gitUri = await GitUri.fromUri(uri, this.git);
29+
// If the sha is missing, just let the user know the file matches
30+
if (gitUri.sha === undefined) return window.showInformationMessage(`File matches the working tree`);
2931

3032
try {
3133
args.commit = await this.git.getLogCommit(gitUri.repoPath, gitUri.fsPath, gitUri.sha, { firstIfMissing: true });

0 commit comments

Comments
 (0)