mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
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:
parent
dde1d2736e
commit
b8a5e18171
|
@ -2189,6 +2189,11 @@
|
|||
"default": false,
|
||||
"description": "%config.useCommitInputAsStashMessage%"
|
||||
},
|
||||
"git.useIntegratedAskPass": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "%config.useIntegratedAskPass%"
|
||||
},
|
||||
"git.githubAuthentication": {
|
||||
"deprecationMessage": "This setting is now deprecated, please use `github.gitAuthentication` instead."
|
||||
},
|
||||
|
|
|
@ -200,6 +200,7 @@
|
|||
"config.experimental.installGuide": "Experimental improvements for the git setup flow.",
|
||||
"config.repositoryScanIgnoredFolders": "List of folders that are ignored while scanning for Git repositories when `#git.autoRepositoryDetection#` is set to `true` or `subFolders`.",
|
||||
"config.repositoryScanMaxDepth": "Controls the depth used when scanning workspace folders for Git repositories when `#git.autoRepositoryDetection#` is set to `true` or `subFolders`. Can be set to `-1` for no limit.",
|
||||
"config.useIntegratedAskPass": "Controls whether GIT_ASKPASS should be overwritten to use the integrated version.",
|
||||
"submenu.explorer": "Git",
|
||||
"submenu.commit": "Commit",
|
||||
"submenu.commit.amend": "Amend",
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue