diff options
author | Eric Wong <e@80x24.org> | 2023-10-17 23:37:52 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-18 20:50:24 +0000 |
commit | 19b791f4894efcb6e545a6b51c8147298363358f (patch) | |
tree | 16a806fcb0c8fdaef242a2d268a8b1416809b46f /lib/PublicInbox/MultiGit.pm | |
parent | 35b0f7aa00a24f5d89b1b941ec644327ba074c99 (diff) | |
download | public-inbox-19b791f4894efcb6e545a6b51c8147298363358f.tar.gz |
`readline' ops may not detect errors on partial reads. This saves us some code to reduce cognitive overhead for readers. We'll also support reusing a destination buffers so it can work more nicely with existing code.
Diffstat (limited to 'lib/PublicInbox/MultiGit.pm')
-rw-r--r-- | lib/PublicInbox/MultiGit.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/MultiGit.pm b/lib/PublicInbox/MultiGit.pm index 74a9e1df..35bd0251 100644 --- a/lib/PublicInbox/MultiGit.pm +++ b/lib/PublicInbox/MultiGit.pm @@ -9,6 +9,7 @@ use PublicInbox::Spawn qw(run_die popen_rd); use PublicInbox::Import; use File::Temp 0.19; use List::Util qw(max); +use PublicInbox::Git qw(read_all); sub new { my ($cls, $topdir, $all, $epfx) = @_; @@ -31,7 +32,7 @@ sub read_alternates { qr!\A\Q../../$self->{epfx}\E/([0-9]+)\.git/objects\z! : undef; $$moderef = (stat($fh))[2] & 07777; - for my $rel (split(/^/m, do { local $/; <$fh> })) { + for my $rel (split(/^/m, read_all($fh, -s _))) { chomp(my $dir = $rel); my $score; if (defined($is_edir) && $dir =~ $is_edir) { |