git: isolate ipc env

This commit is contained in:
Joao Moreno
2019-11-20 16:06:55 +01:00
parent af864aed2f
commit f37b9d742c
5 changed files with 22 additions and 12 deletions

View File

@@ -34,15 +34,16 @@ export async function deactivate(): Promise<any> {
async function createModel(context: ExtensionContext, outputChannel: OutputChannel, telemetryReporter: TelemetryReporter, disposables: Disposable[]): Promise<Model> {
const pathHint = workspace.getConfiguration('git').get<string>('path');
const info = await findGit(pathHint, path => outputChannel.appendLine(localize('looking', "Looking for git in: {0}", path)));
let env: any = undefined;
let env: any = {};
try {
const ipc = await createIPCServer();
disposables.push(ipc);
env = { ...env, ...ipc.getEnv() };
const askpass = new Askpass(ipc);
disposables.push(askpass);
env = askpass.getEnv();
env = { ...env, ...askpass.getEnv() };
} catch {
env = Askpass.getDisabledEnv();
}