diff options
author | Russ Allbery <rra@cpan.org> | 2021-12-26 21:58:40 -0800 |
---|---|---|
committer | Russ Allbery <rra@cpan.org> | 2021-12-26 21:58:40 -0800 |
commit | c4444d640d251e8617c91836a6e8f69fd4560337 (patch) | |
tree | 199c39b60c87ff8934bcf55083792b2511772c63 /t | |
parent | 3a32578ab06e1ab63f7ebcf93818c3758f0b3527 (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-x | t/dist/basic.t | 7 |
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(); |