diff --git a/git_command.py b/git_command.py index 1ec7c3ed..55216b1c 100644 --- a/git_command.py +++ b/git_command.py @@ -313,12 +313,15 @@ class GitCommand: cwd = None command_name = cmdv[0] command.append(command_name) - # Need to use the --progress flag for fetch/clone so output will be - # displayed as by default git only does progress output if stderr is a - # TTY. - if sys.stderr.isatty() and command_name in ("fetch", "clone"): - if "--progress" not in cmdv and "--quiet" not in cmdv: - command.append("--progress") + + if command_name in ("fetch", "clone"): + env["GIT_TERMINAL_PROMPT"] = "0" + # Need to use the --progress flag for fetch/clone so output will be + # displayed as by default git only does progress output if stderr is + # a TTY. + if sys.stderr.isatty(): + if "--progress" not in cmdv and "--quiet" not in cmdv: + command.append("--progress") command.extend(cmdv[1:]) event_log = ( diff --git a/project.py b/project.py index dda01331..b281863b 100644 --- a/project.py +++ b/project.py @@ -2697,6 +2697,19 @@ class Project: ) # Continue right away so we don't sleep as we shouldn't need to. continue + elif ( + ret == 128 + and gitcmd.stdout + and "fatal: could not read Username" in gitcmd.stdout + ): + # User needs to be authenticated, and Git wants to prompt for + # username and password. + print( + "git requires authentication, but repo cannot perform " + "interactive authentication. Check git credentials.", + file=output_redir, + ) + break elif current_branch_only and is_sha1 and ret == 128: # Exit code 128 means "couldn't find the ref you asked for"; if # we're in sha1 mode, we just tried sync'ing from the upstream