Allow disabling integrated askpass (#115455)

The GIT_ASKPASS variable is currently enforced by vscode and there is no way to overwrite it.
This commit adds an options to disable the integrated askpass and use
your own.

Fixes #111839
This commit is contained in:
Backfighter
2022-03-21 16:31:04 +01:00
committed by GitHub
parent dde1d2736e
commit b8a5e18171
3 changed files with 14 additions and 2 deletions

View File

@@ -79,13 +79,19 @@ export class Askpass implements IIPCHandler {
};
}
return {
let env: { [key: string]: string; } = {
...this.ipc.getEnv(),
GIT_ASKPASS: path.join(__dirname, 'askpass.sh'),
VSCODE_GIT_ASKPASS_NODE: process.execPath,
VSCODE_GIT_ASKPASS_EXTRA_ARGS: (process.versions['electron'] && process.versions['microsoft-build']) ? '--ms-enable-electron-run-as-node' : '',
VSCODE_GIT_ASKPASS_MAIN: path.join(__dirname, 'askpass-main.js')
};
const config = workspace.getConfiguration('git');
if (config.get<boolean>('useIntegratedAskPass')) {
env.GIT_ASKPASS = path.join(__dirname, 'askpass.sh');
}
return env;
}
registerCredentialsProvider(provider: CredentialsProvider): Disposable {