]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import: pass --quiet to `git gc' if STDERR isn't a tty
authorEric Wong <e@80x24.org>
Fri, 2 Sep 2022 18:26:23 +0000 (18:26 +0000)
committerEric Wong <e@80x24.org>
Sun, 4 Sep 2022 14:41:44 +0000 (14:41 +0000)
No need to pollute non-interactive output for gc use.  This
suppresses notifications from my `lei up --all -q' cronjob.

lib/PublicInbox/Import.pm

index 2c8f310acffedc488d3e6ac45bc2ed875819033f..0419217419e65116d57c0f2d0613b74f601e0b9a 100644 (file)
@@ -192,7 +192,10 @@ sub _update_git_info ($$) {
                };
                warn "$ibx->{inboxdir} index failed: $@\n" if $@;
        }
-       eval { run_die([@cmd, qw(gc --auto)]) } if $do_gc;
+       if ($do_gc) {
+               my @quiet = (-t STDERR ? () : '-q');
+               eval { run_die([@cmd, qw(gc --auto), @quiet]) }
+       }
 }
 
 sub barrier {