about summary refs log tree commit homepage
path: root/lib/PublicInbox/Git.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-29 12:42:58 +0500
committerEric Wong <e@80x24.org>2021-01-30 01:08:20 +0000
commitd679cbb1b5ad95d2689bc3b8f78da2b380fc7860 (patch)
treee535b8117a639b55a5e57c6fae8f14977ea367ee /lib/PublicInbox/Git.pm
parent401803a9e717ba05c8a73f9bf60d1175b316bb77 (diff)
downloadpublic-inbox-d679cbb1b5ad95d2689bc3b8f78da2b380fc7860.tar.gz
Instead of forcing callers to set a variable to write into,
we'll just rely on wantarray.
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r--lib/PublicInbox/Git.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index 3d97300c..c6c1c802 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -240,17 +240,16 @@ sub batch_prepare ($) {
 }
 
 sub _cat_file_cb {
-        my ($bref, undef, undef, $size, $result) = @_;
-        @$result = ($bref, $size);
+        my ($bref, $oid, $type, $size, $result) = @_;
+        @$result = ($bref, $oid, $type, $size);
 }
 
 sub cat_file {
-        my ($self, $oid, $sizeref) = @_;
+        my ($self, $oid) = @_;
         my $result = [];
         cat_async($self, $oid, \&_cat_file_cb, $result);
         cat_async_wait($self);
-        $$sizeref = $result->[1] if $sizeref;
-        $result->[0];
+        wantarray ? @$result : $result->[0];
 }
 
 sub check_async_step ($$) {