Skip to content

Commit

Permalink
Allow Git to request user credentials if specifically desired
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewschueler committed Dec 5, 2022
1 parent f594246 commit 7eb0475
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/poetry/vcs/git/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ def run(*args: Any, **kwargs: Any) -> str:

git_command = find_git_command()
env = os.environ.copy()
env["GIT_TERMINAL_PROMPT"] = "0"
try:
result = env["GIT_TERMINAL_PROMPT"]
print(f"GIT_TERMINAL_PROMPT state:\t{result}")
except KeyError:
# Preserve default behavior - don't ask for password
env["GIT_TERMINAL_PROMPT"] = "0"
print("Default GIT_TERMINAL_PROMPT set to \"0\"")
return (
subprocess.check_output(
git_command + list(args),
Expand Down

0 comments on commit 7eb0475

Please sign in to comment.