diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-03-06 09:48:01 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-03-06 09:48:01 -0700 |
commit | b2de6d0fa691b87d0de3821b8743d89b2777a767 (patch) | |
tree | e57708e2dc5dd24e1139a3ac84e74ea9b40a19f3 /bin/locmaint | |
parent | ad68c12611fbc9da875acb89107e99f61b47ab72 (diff) | |
download | dotfiles-b2de6d0fa691b87d0de3821b8743d89b2777a767.tar.gz |
set GIT_TERMINAL_PROMPT in locmaint
Diffstat (limited to 'bin/locmaint')
-rwxr-xr-x | bin/locmaint | 10 |
1 files changed, 10 insertions, 0 deletions
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'" |