From d679cbb1b5ad95d2689bc3b8f78da2b380fc7860 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 29 Jan 2021 12:42:58 +0500 Subject: git: synchronous cat_file may return type and OID Instead of forcing callers to set a variable to write into, we'll just rely on wantarray. --- t/git.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't') diff --git a/t/git.t b/t/git.t index 377652ca..0c85e492 100644 --- a/t/git.t +++ b/t/git.t @@ -70,10 +70,10 @@ if (1) { chomp $buf; my $gcf = PublicInbox::Git->new($dir); - my $rsize; - my $x = $gcf->cat_file($buf, \$rsize); - is($rsize, $size, 'got correct size ref on big file'); - is(length($$x), $size, 'read correct number of bytes'); + my @x = $gcf->cat_file($buf); + is($x[2], 'blob', 'got blob on wantarray'); + is($x[3], $size, 'got correct size ref on big file'); + is(length(${$x[0]}), $size, 'read correct number of bytes'); my $ref = $gcf->qx(qw(cat-file blob), $buf); is($?, 0, 'no error on scalar success'); -- cgit v1.2.3-24-ge0c7