From 54d8261f93607fbf0e74bef63ffe6251d64dc0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Mon, 27 Apr 2020 14:51:24 +0200 Subject: [PATCH] git: config.terminalAuthentication --- extensions/git/package.json | 6 ++++++ extensions/git/package.nls.json | 1 + extensions/git/src/ipc/ipcServer.ts | 1 - extensions/git/src/main.ts | 7 +++---- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/extensions/git/package.json b/extensions/git/package.json index 641d81ae6ed..48dee7d31e1 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -1665,6 +1665,12 @@ "scope": "resource", "default": true, "description": "%config.showCommitInput%" + }, + "git.terminalAuthentication": { + "type": "boolean", + "scope": "resource", + "default": true, + "description": "%config.terminalAuthentication%" } } }, diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 2ea91658e9c..e2ca167936e 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -144,6 +144,7 @@ "config.untrackedChanges.separate": "Untracked changes appear separately in the Source Control view. They are also excluded from several actions.", "config.untrackedChanges.hidden": "Untracked changes are hidden and excluded from several actions.", "config.showCommitInput": "Controls whether to show the commit input in the Git source control panel.", + "config.terminalAuthentication": "Controls whether to enable VS Code to be the authentication handler for git processes spawned in the integrated terminal.", "colors.added": "Color for added resources.", "colors.modified": "Color for modified resources.", "colors.deleted": "Color for deleted resources.", diff --git a/extensions/git/src/ipc/ipcServer.ts b/extensions/git/src/ipc/ipcServer.ts index 139ea9dac0a..5cea9faf98f 100644 --- a/extensions/git/src/ipc/ipcServer.ts +++ b/extensions/git/src/ipc/ipcServer.ts @@ -29,7 +29,6 @@ export interface IIPCHandler { export async function createIPCServer(context?: string): Promise { const server = http.createServer(); - const hash = crypto.createHash('sha1'); if (!context) { diff --git a/extensions/git/src/main.ts b/extensions/git/src/main.ts index 599f2f34e7e..48d6396e136 100644 --- a/extensions/git/src/main.ts +++ b/extensions/git/src/main.ts @@ -23,6 +23,7 @@ import * as fs from 'fs'; import { GitTimelineProvider } from './timelineProvider'; import { registerAPICommands } from './api/api1'; import { GitHubCredentialProvider } from './github'; +import { TerminalEnvironmentManager } from './terminal'; const deactivateTasks: { (): Promise; }[] = []; @@ -40,10 +41,8 @@ async function createModel(context: ExtensionContext, outputChannel: OutputChann disposables.push(askpass); const env = askpass.getEnv(); - - for (const name of Object.keys(env)) { - context.environmentVariableCollection.replace(name, env[name]); - } + const terminalEnvironmentManager = new TerminalEnvironmentManager(context, env); + disposables.push(terminalEnvironmentManager); context.subscriptions.push(askpass.registerCredentialsProvider(new GitHubCredentialProvider()));