Skip to content

Commit b21537c

Browse files
authored
Git - enable commit signing using SSH key (microsoft#201298)
1 parent d32043d commit b21537c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

extensions/git/package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
"config.smartCommitChanges.all": "Automatically stage all changes.",
169169
"config.smartCommitChanges.tracked": "Automatically stage tracked changes only.",
170170
"config.suggestSmartCommit": "Suggests to enable smart commit (commit all changes when there are no staged changes).",
171-
"config.enableCommitSigning": "Enables commit signing with GPG or X.509.",
171+
"config.enableCommitSigning": "Enables commit signing with GPG, X.509, or SSH.",
172172
"config.discardAllScope": "Controls what changes are discarded by the `Discard all changes` command. `all` discards all changes. `tracked` discards only tracked files. `prompt` shows a prompt dialog every time the action is run.",
173173
"config.decorations.enabled": "Controls whether Git contributes colors and badges to the Explorer and the Open Editors view.",
174174
"config.enableStatusBarSync": "Controls whether the Git Sync command appears in the status bar.",

extensions/git/src/askpass-main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ function main(argv: string[]): void {
4646
if (askpassType === 'ssh') {
4747
if (/passphrase/i.test(request)) {
4848
// passphrase
49-
file = argv[6].replace(/^["']+|["':]+$/g, '');
49+
// Commit signing - Enter passphrase:
50+
// Git operation - Enter passphrase for key '/c/Users/<username>/.ssh/id_ed25519':
51+
file = argv[6]?.replace(/^["']+|["':]+$/g, '');
5052
} else {
5153
// authenticity
5254
host = argv[6].replace(/^["']+|["':]+$/g, '');

extensions/git/src/askpass.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class Askpass implements IIPCHandler, ITerminalEnvironmentProvider {
102102
const options: InputBoxOptions = {
103103
password: true,
104104
placeHolder: l10n.t('Passphrase'),
105-
prompt: `SSH Key: ${file}`,
105+
prompt: file ? `SSH Key: ${file}` : undefined,
106106
ignoreFocusOut: true
107107
};
108108

0 commit comments

Comments
 (0)