From: Eric Wong Date: Sat, 11 Jan 2020 22:34:56 +0000 (+0000) Subject: git: modified: don't slurp `rev-parse --branches' X-Git-Tag: v1.3.0~110 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=6d8658803b0f75ccdc54d16c8fda4e2cfaed0388 git: modified: don't slurp `rev-parse --branches' While v1 inboxes typically only have one branch, code repositories may have dozens or even hundreds. Slurping those into memory is a waste. --- diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 8ee04e17..0ace907e 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -347,7 +347,7 @@ sub modified ($) { my $fh = popen($self, qw(rev-parse --branches)); cat_async_begin($self); local $/ = "\n"; - foreach my $oid (<$fh>) { + while (my $oid = <$fh>) { chomp $oid; cat_async($self, $oid, \&extract_cmt_time, \$modified); }