Skip to content

Commit 4325bd3

Browse files
committed
Allow disabling integrated askpass
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
1 parent 01e92bd commit 4325bd3

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

extensions/git/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,6 +2088,11 @@
20882088
"default": false,
20892089
"description": "%config.useCommitInputAsStashMessage%"
20902090
},
2091+
"git.useIntegratedAskPass": {
2092+
"type": "boolean",
2093+
"default": true,
2094+
"description": "%config.useIntegratedAskPass%"
2095+
},
20912096
"git.githubAuthentication": {
20922097
"deprecationMessage": "This setting is now deprecated, please use `github.gitAuthentication` instead."
20932098
},

extensions/git/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
"config.timeline.date.committed": "Use the committed date",
184184
"config.timeline.date.authored": "Use the authored date",
185185
"config.useCommitInputAsStashMessage": "Controls whether to use the message from the commit input box as the default stash message.",
186+
"config.useIntegratedAskPass": "Controls wether GIT_ASKPASS should be overwritten to use the integrated version.",
186187
"submenu.explorer": "Git",
187188
"submenu.commit": "Commit",
188189
"submenu.commit.amend": "Amend",

extensions/git/src/askpass.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,18 @@ export class Askpass implements IIPCHandler {
7979
};
8080
}
8181

82-
return {
82+
let env: { [key: string]: string; } = {
8383
...this.ipc.getEnv(),
84-
GIT_ASKPASS: path.join(__dirname, 'askpass.sh'),
8584
VSCODE_GIT_ASKPASS_NODE: process.execPath,
8685
VSCODE_GIT_ASKPASS_MAIN: path.join(__dirname, 'askpass-main.js')
8786
};
87+
88+
const config = workspace.getConfiguration('git');
89+
if (config.get<boolean>('useIntegratedAskPass')) {
90+
env.GIT_ASKPASS = path.join(__dirname, 'askpass.sh');
91+
}
92+
93+
return env;
8894
}
8995

9096
registerCredentialsProvider(provider: CredentialsProvider): Disposable {

0 commit comments

Comments
 (0)