Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not overwrite users environment variables #115455

Merged
merged 1 commit into from Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions extensions/git/package.json
Expand Up @@ -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."
},
Expand Down
1 change: 1 addition & 0 deletions extensions/git/package.nls.json
Expand Up @@ -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",
Expand Down
10 changes: 8 additions & 2 deletions extensions/git/src/askpass.ts
Expand Up @@ -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 {
Expand Down