about summary refs log tree commit homepage
path: root/lib/PublicInbox/Git.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-12-24 11:36:33 +0000
committerEric Wong <e@80x24.org>2016-04-05 18:58:27 +0000
commit3377b0c87167d6a8a4df5c8fa05be030e9b5caa4 (patch)
tree47298b69d67f2e9b4bd1a3178807010076976190 /lib/PublicInbox/Git.pm
parent4be6ef4cf0d38a45fc22f0d92ab24e0b04639030 (diff)
downloadpublic-inbox-3377b0c87167d6a8a4df5c8fa05be030e9b5caa4.tar.gz
This metadata can be useful on an optional basis; allowing
calls to $git->check to be skipped.
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r--lib/PublicInbox/Git.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index 0f92dd9a..4bc879ff 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -43,10 +43,10 @@ sub cat_file {
         my $in = $self->{in};
         my $head = $in->getline;
         $head =~ / missing$/ and return undef;
-        $head =~ /^[0-9a-f]{40} \S+ (\d+)$/ or
+        $head =~ /^([0-9a-f]{40}) (\S+) (\d+)$/ or
                 fail($self, "Unexpected result from git cat-file: $head");
 
-        my $size = $1;
+        my ($hex, $type, $size) = ($1, $2, $3);
         my $ref_type = $ref ? ref($ref) : '';
 
         my $rv;
@@ -55,7 +55,7 @@ sub cat_file {
         my $cb_err;
 
         if ($ref_type eq 'CODE') {
-                $rv = eval { $ref->($in, \$left) };
+                $rv = eval { $ref->($in, \$left, $type, $hex) };
                 $cb_err = $@;
                 # drain the rest
                 my $max = 8192;