mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +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:
@@ -2189,6 +2189,11 @@
|
|||||||
"default": false,
|
"default": false,
|
||||||
"description": "%config.useCommitInputAsStashMessage%"
|
"description": "%config.useCommitInputAsStashMessage%"
|
||||||
},
|
},
|
||||||
|
"git.useIntegratedAskPass": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "%config.useIntegratedAskPass%"
|
||||||
|
},
|
||||||
"git.githubAuthentication": {
|
"git.githubAuthentication": {
|
||||||
"deprecationMessage": "This setting is now deprecated, please use `github.gitAuthentication` instead."
|
"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.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.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.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.explorer": "Git",
|
||||||
"submenu.commit": "Commit",
|
"submenu.commit": "Commit",
|
||||||
"submenu.commit.amend": "Amend",
|
"submenu.commit.amend": "Amend",
|
||||||
|
|||||||
@@ -79,13 +79,19 @@ export class Askpass implements IIPCHandler {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
let env: { [key: string]: string; } = {
|
||||||
...this.ipc.getEnv(),
|
...this.ipc.getEnv(),
|
||||||
GIT_ASKPASS: path.join(__dirname, 'askpass.sh'),
|
|
||||||
VSCODE_GIT_ASKPASS_NODE: process.execPath,
|
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_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')
|
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 {
|
registerCredentialsProvider(provider: CredentialsProvider): Disposable {
|
||||||
|
|||||||
Reference in New Issue
Block a user