+my $COPYING = 'dba13ed2ddf783ee8118c6a581dbf75305f816a3';
+open my $agpl, '<', 'COPYING' or BAIL_OUT "AGPL-3 missing: $!";
+$agpl = do { local $/; <$agpl> };
+
+PublicInbox::Import::init_bare($tmpdir);
+my $fi_data = './t/git.fast-import-data';
+my $rdr = {};
+open $rdr->{0}, '<', $fi_data or BAIL_OUT $!;
+xsys([qw(git fast-import --quiet)], { GIT_DIR => $tmpdir }, $rdr);
+is($?, 0, 'fast-import succeeded');
+$gcf2->add_alternate("$tmpdir/objects");
+
+{
+ my ($r, $w);
+ pipe($r, $w) or BAIL_OUT $!;
+ my $tree = 'fdbc43725f21f485051c17463b50185f4c3cf88c';
+ $gcf2->cat_oid(fileno($w), $tree);
+ close $w;
+ is("$tree tree 30\n", <$r>, 'tree header ok');
+ $r = do { local $/; <$r> };
+ is(chop($r), "\n", 'got trailing newline');
+ is(length($r), 30, 'tree length matches');
+}
+