From b2de6d0fa691b87d0de3821b8743d89b2777a767 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 6 Mar 2020 09:48:01 -0700 Subject: set GIT_TERMINAL_PROMPT in locmaint --- bin/locmaint | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bin/locmaint') diff --git a/bin/locmaint b/bin/locmaint index d6253c9c..f6e6b51a 100755 --- a/bin/locmaint +++ b/bin/locmaint @@ -236,6 +236,13 @@ sub do_homedir { # so the machine can be left unattended. We autoci first because # that increases the chance the update will succeed on its own unless ($skip_update) { + # avoid git asking for creds on the terminal which will + # typically happen when a git remote no longer exists + # (e.g. because someone has deleted their fork). Another + # related trick is setting GIT_ASKPASS=/bin/true but that's a + # larger hammer than doing this + local $ENV{GIT_TERMINAL_PROMPT} = "0"; + script_status("trying to update all repos"); foreach my $mr_repo (@mr_repos) { $mr_repo->auto_commit(); @@ -246,6 +253,9 @@ sub do_homedir { foreach my $mr_repo (@mr_repos) { script_status("reviewing repo " . $mr_repo->toplevel); unless ($mr_repo->updated || $skip_update) { + # see comment above for why we're setting this to 0 here + local $ENV{GIT_TERMINAL_PROMPT} = "0"; + interactive_ensure_subroutine_success(sub { $mr_repo->update() }, $mr_repo->toplevel, "try running `mr update'" -- cgit v1.2.3