Skip to content

Commit 1ff25a4

Browse files
committed
Update /src/diff.ts; Update /src/extension.ts
- Fall through to built-in git diff for non-git-crypt files - Rename output channel and warning prefix to "git-crypt Diff" - Remove unused GIT_CRYPT_SCHEME import
1 parent 6f6860e commit 1ff25a4

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/diff.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as vscode from 'vscode';
22
import * as path from 'node:path';
33
import { GitCryptDetector } from './detector.js';
4-
import { encodeGitCryptUri, GIT_CRYPT_SCHEME } from './uriUtil.js';
4+
import { encodeGitCryptUri } from './uriUtil.js';
55

66
export async function showDiff(
77
detector: GitCryptDetector,
@@ -15,15 +15,16 @@ export async function showDiff(
1515
}
1616

1717
if (!fileUri || fileUri.scheme !== 'file') {
18-
vscode.window.showWarningMessage('Git Crypt: No file selected');
18+
vscode.window.showWarningMessage('git-crypt Diff: No file selected');
1919
return;
2020
}
2121

2222
const absolutePath = fileUri.fsPath;
2323
const match = detector.findRepoAndRelPath(absolutePath);
2424

2525
if (!match) {
26-
vscode.window.showWarningMessage('Git Crypt: This file is not managed by git-crypt');
26+
// Not a git-crypt file -- fall through to the built-in git diff
27+
await vscode.commands.executeCommand('git.openChange', fileUri);
2728
return;
2829
}
2930

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { resolveContent } from './contentProvider.js';
55
import { GIT_CRYPT_SCHEME } from './uriUtil.js';
66
import { registerDiffCommand } from './diff.js';
77

8-
const log = vscode.window.createOutputChannel('Git Crypt');
8+
const log = vscode.window.createOutputChannel('git-crypt Diff');
99

1010
class GitCryptDecorationProvider implements vscode.FileDecorationProvider {
1111
private _onDidChange = new vscode.EventEmitter<vscode.Uri | vscode.Uri[]>();

0 commit comments

Comments
 (0)