-# Copyright (C) 2015-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2015-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
use warnings;
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');
my @ref = $gcf->qx(qw(cat-file blob), $buf);
+ is($?, 0, 'no error on wantarray success');
my $nl = scalar @ref;
ok($nl > 1, "qx returned array length of $nl");
+ is(join('', @ref), $ref, 'qx array and scalar context both work');
$gcf->qx(qw(repack -adq));
ok($gcf->packed_bytes > 0, 'packed size is positive');
+ $gcf->qx(qw(rev-parse --verify bogus));
+ isnt($?, 0, '$? set on failure'.$?);
}
SKIP: {