Git - fix file path parsing issue in askpass (#257422)

Git - fix file path parsin issue in askpass
This commit is contained in:
Ladislau Szomoru
2025-07-23 10:33:33 +00:00
committed by GitHub
parent 8ab30c5999
commit ebd5fb15ef
2 changed files with 34 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { window, InputBoxOptions, Uri, Disposable, workspace, QuickPickOptions, l10n, LogOutputChannel } from 'vscode';
import { IDisposable, EmptyDisposable, toDisposable } from './util';
import { IDisposable, EmptyDisposable, toDisposable, extractFilePathFromArgs } from './util';
import * as path from 'path';
import { IIPCHandler, IIPCServer } from './ipc/ipcServer';
import { CredentialsProvider, Credentials } from './api/git';
@@ -108,7 +108,7 @@ export class Askpass implements IIPCHandler, ITerminalEnvironmentProvider {
if (/passphrase/i.test(request)) {
// Commit signing - Enter passphrase:
// Git operation - Enter passphrase for key '/c/Users/<username>/.ssh/id_ed25519':
const file = argv[6]?.replace(/^["']+|["':]+$/g, '');
const file = extractFilePathFromArgs(argv, 6);
this.logger.trace(`[Askpass][handleSSHAskpass] request: ${request}, file: ${file}`);