diff --git a/app/src/lib/git/authentication.ts b/app/src/lib/git/authentication.ts index cd1749d9d5..8ac376f3ba 100644 --- a/app/src/lib/git/authentication.ts +++ b/app/src/lib/git/authentication.ts @@ -8,7 +8,7 @@ export function envForAuthentication(auth: IGitAccount | null): Object { const env = { DESKTOP_PATH: process.execPath, DESKTOP_ASKPASS_SCRIPT: getAskPassScriptPath(), - DESKTOP_IDENTIFIER: 'ASKPASS', + DESKTOP_TRAMPOLINE_IDENTIFIER: 'ASKPASS', GIT_ASKPASS: getAskPassTrampolinePath(), // supported since Git 2.3, this is used to ensure we never interactively prompt // for credentials - even as a fallback diff --git a/app/src/lib/trampoline/trampoline-server.ts b/app/src/lib/trampoline/trampoline-server.ts index 6e5ec47bd0..7ca9358850 100644 --- a/app/src/lib/trampoline/trampoline-server.ts +++ b/app/src/lib/trampoline/trampoline-server.ts @@ -9,7 +9,6 @@ interface ITrampolineCommand { } enum TrampolineCommandParserState { - Identifier, ParameterCount, Parameters, EnvironmentVariablesCount, @@ -18,14 +17,13 @@ enum TrampolineCommandParserState { } class TrampolineCommandParser { - private identifier: string | null = null private parameterCount: number = 0 private readonly parameters: string[] = [] private environmentVariablesCount: number = 0 private readonly environmentVariables = new Map() private state: TrampolineCommandParserState = - TrampolineCommandParserState.Identifier + TrampolineCommandParserState.ParameterCount public hasFinished() { return this.state === TrampolineCommandParserState.Finished @@ -33,12 +31,6 @@ class TrampolineCommandParser { public processValue(value: string) { switch (this.state) { - case TrampolineCommandParserState.Identifier: - this.identifier = value - console.log(`Trampoline parsed identifier ${value}`) - this.state = TrampolineCommandParserState.ParameterCount - break - case TrampolineCommandParserState.ParameterCount: this.parameterCount = parseInt(value) console.log(`Trampoline parsed parameterCount ${value}`) @@ -108,10 +100,12 @@ class TrampolineCommandParser { ) } - const identifier = this.identifier + const identifier = this.environmentVariables.get( + 'DESKTOP_TRAMPOLINE_IDENTIFIER' + ) - if (identifier === null) { - throw new Error('The command identifier cannot be null') + if (identifier === undefined) { + throw new Error('The command identifier is missing') } return {