From 63c4f3fffd99f7b0b3a5f2ff743bd92d506e3765 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Sun, 19 Jun 2022 13:46:17 +0100 Subject: [PATCH] tell git not to use terminal prompts --- src/poetry/vcs/git/system.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/poetry/vcs/git/system.py b/src/poetry/vcs/git/system.py index c1520539462..5ed84733387 100644 --- a/src/poetry/vcs/git/system.py +++ b/src/poetry/vcs/git/system.py @@ -1,5 +1,6 @@ from __future__ import annotations +import os import subprocess from typing import TYPE_CHECKING @@ -49,8 +50,14 @@ def run(*args: Any, **kwargs: Any) -> str: ) + args git_command = find_git_command() + env = os.environ.copy() + env["GIT_TERMINAL_PROMPT"] = "0" return ( - subprocess.check_output(git_command + list(args), stderr=subprocess.STDOUT) + subprocess.check_output( + git_command + list(args), + stderr=subprocess.STDOUT, + env=env, + ) .decode() .strip() )