diff options
Diffstat (limited to 'extensions/git/src/askpass.ts')
-rw-r--r-- | extensions/git/src/askpass.ts | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/extensions/git/src/askpass.ts b/extensions/git/src/askpass.ts index ffbd7e48a0e..81895a0e0d6 100644 --- a/extensions/git/src/askpass.ts +++ b/extensions/git/src/askpass.ts @@ -6,8 +6,9 @@ import { window, InputBoxOptions, Uri, Disposable, workspace } from 'vscode'; import { IDisposable, EmptyDisposable, toDisposable } from './util'; import * as path from 'path'; -import { IIPCHandler, IIPCServer } from './ipc/ipcServer'; +import { IIPCHandler, IIPCServer, createIPCServer } from './ipc/ipcServer'; import { CredentialsProvider, Credentials } from './api/git'; +import { OutputChannelLogger } from './log'; export class Askpass implements IIPCHandler { @@ -15,7 +16,16 @@ export class Askpass implements IIPCHandler { private cache = new Map<string, Credentials>(); private credentialsProviders = new Set<CredentialsProvider>(); - constructor(private ipc?: IIPCServer) { + static async create(outputChannelLogger: OutputChannelLogger, context?: string): Promise<Askpass> { + try { + return new Askpass(await createIPCServer(context)); + } catch (err) { + outputChannelLogger.logError(`Failed to create git askpass IPC: ${err}`); + return new Askpass(); + } + } + + private constructor(private ipc?: IIPCServer) { if (ipc) { this.disposable = ipc.registerHandler('askpass', this); } |