summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRuss Allbery <rra@cpan.org>2021-12-26 21:58:40 -0800
committerRuss Allbery <rra@cpan.org>2021-12-26 21:58:40 -0800
commitc4444d640d251e8617c91836a6e8f69fd4560337 (patch)
tree199c39b60c87ff8934bcf55083792b2511772c63 /t
parent3a32578ab06e1ab63f7ebcf93818c3758f0b3527 (diff)
Hopefully better probe for git archive
The t/dist/basic.t test fails on Solaris because git archive produces a tar file that's incompatible with pax. Try harder to probe for that error message, which for some reason isn't being triggered by the test to see if we should skip this test.
Diffstat (limited to 't')
-rwxr-xr-xt/dist/basic.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/dist/basic.t b/t/dist/basic.t
index 6fcf2bc..dcc6b1b 100755
--- a/t/dist/basic.t
+++ b/t/dist/basic.t
@@ -20,6 +20,7 @@ use File::Temp;
use Git::Repository;
use IPC::Run qw(run);
use IPC::System::Simple qw(capturex systemx);
+use List::Util qw(first);
use Test::More;
@@ -52,9 +53,13 @@ $repo->run(add => '-A', q{.});
$repo->run(commit => '-q', '-m', 'Initial commit');
# Check whether we have all the necessary tools to run the test.
+my @branches = $repo->run(
+ 'for-each-ref' => '--format=%(refname:short)', 'refs/heads/',
+);
+my $head = first { $_ eq 'main' || $_ eq 'master' } @branches;
my $result;
eval {
- my $archive = $repo->command(archive => 'HEAD');
+ my $archive = $repo->command(archive => '--prefix=foo/', $head);
my $out;
$result = run([qw(tar tf -)], '<', $archive->stdout, '>', \$out);
$archive->close();