From 67a34dd74d26d574168e0eac7058a2ca2bb714d8 Mon Sep 17 00:00:00 2001 From: Matt Seddon Date: Fri, 28 Apr 2023 10:06:44 +1000 Subject: [PATCH] Add GIT_TERMINAL_PROMPT=0 to DVC environment variables --- extension/src/cli/dvc/executor.test.ts | 1 + extension/src/cli/dvc/index.test.ts | 8 +++++++- extension/src/cli/dvc/options.test.ts | 3 +++ extension/src/cli/dvc/options.ts | 1 + extension/src/cli/dvc/reader.test.ts | 1 + 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/extension/src/cli/dvc/executor.test.ts b/extension/src/cli/dvc/executor.test.ts index b181d07c8f..d4c4f2b4d9 100644 --- a/extension/src/cli/dvc/executor.test.ts +++ b/extension/src/cli/dvc/executor.test.ts @@ -24,6 +24,7 @@ const mockedGetProcessEnv = jest.mocked(getProcessEnv) const mockedEnv = { DVCLIVE_OPEN: 'false', DVC_NO_ANALYTICS: 'true', + GIT_TERMINAL_PROMPT: '0', PATH: '/some/special/path' } diff --git a/extension/src/cli/dvc/index.test.ts b/extension/src/cli/dvc/index.test.ts index d349ec2653..e7c5fe8ee9 100644 --- a/extension/src/cli/dvc/index.test.ts +++ b/extension/src/cli/dvc/index.test.ts @@ -85,7 +85,12 @@ describe('executeDvcProcess', () => { expect(mockedCreateProcess).toHaveBeenCalledWith({ args, cwd, - env: { ...processEnv, DVCLIVE_OPEN: 'false', DVC_NO_ANALYTICS: 'true' }, + env: { + ...processEnv, + DVCLIVE_OPEN: 'false', + DVC_NO_ANALYTICS: 'true', + GIT_TERMINAL_PROMPT: '0' + }, executable: 'dvc' }) }) @@ -127,6 +132,7 @@ describe('executeDvcProcess', () => { env: { DVCLIVE_OPEN: 'false', DVC_NO_ANALYTICS: 'true', + GIT_TERMINAL_PROMPT: '0', PATH: joinEnvPath('/some/path/to', existingPath), SECRET_KEY }, diff --git a/extension/src/cli/dvc/options.test.ts b/extension/src/cli/dvc/options.test.ts index d3c638aceb..c316a8a7e9 100644 --- a/extension/src/cli/dvc/options.test.ts +++ b/extension/src/cli/dvc/options.test.ts @@ -11,6 +11,7 @@ const mockedPATH = '/some/special/path' const mockedEnv = { DVCLIVE_OPEN: 'false', DVC_NO_ANALYTICS: 'true', + GIT_TERMINAL_PROMPT: '0', PATH: mockedPATH } const mockedGetProcessEnv = jest.mocked(getProcessEnv) @@ -42,6 +43,7 @@ describe('getOptions', () => { env: { DVCLIVE_OPEN: 'false', DVC_NO_ANALYTICS: 'true', + GIT_TERMINAL_PROMPT: '0', PATH: joinEnvPath(join('path', 'to', 'python', '.venv'), mockedPATH) }, executable: pythonBinPath @@ -58,6 +60,7 @@ describe('getOptions', () => { env: { DVCLIVE_OPEN: 'false', DVC_NO_ANALYTICS: 'true', + GIT_TERMINAL_PROMPT: '0', PATH: joinEnvPath(join('path', 'to', 'python', '.venv'), mockedPATH) }, executable: cliPath diff --git a/extension/src/cli/dvc/options.ts b/extension/src/cli/dvc/options.ts index 50f8898122..76a26345ba 100644 --- a/extension/src/cli/dvc/options.ts +++ b/extension/src/cli/dvc/options.ts @@ -21,6 +21,7 @@ const getEnv = (pythonBinPath?: string): NodeJS.ProcessEnv => { ...env, DVCLIVE_OPEN: 'false', DVC_NO_ANALYTICS: 'true', + GIT_TERMINAL_PROMPT: '0', PATH } } diff --git a/extension/src/cli/dvc/reader.test.ts b/extension/src/cli/dvc/reader.test.ts index 87dbcc44e4..9ca8aaf56c 100644 --- a/extension/src/cli/dvc/reader.test.ts +++ b/extension/src/cli/dvc/reader.test.ts @@ -28,6 +28,7 @@ const mockedGetProcessEnv = jest.mocked(getProcessEnv) const mockedEnv = { DVCLIVE_OPEN: 'false', DVC_NO_ANALYTICS: 'true', + GIT_TERMINAL_PROMPT: '0', PATH: '/all/of/the/goodies:/in/my/path' } const JSON_FLAG = '--json'