diff options
author | Eric Wong <e@80x24.org> | 2019-01-10 04:53:10 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-01-10 06:46:49 +0000 |
commit | 50c822076abee76c3133ffc3482488392eecedfb (patch) | |
tree | 903752fbe9b3497cfaa67a8739d901223d91f9a9 /t/import.t | |
parent | e041f5446ad266ee24e41a38e0090e2a65167606 (diff) | |
download | public-inbox-50c822076abee76c3133ffc3482488392eecedfb.tar.gz |
This allows v1 tests to continue working on git 1.8.0 for now. This allows git 2.1.4 packaged with Debian 8 ("jessie") to run old tests, at least. I suppose it's safe to drop Debian 7 ("wheezy") due to our dependency on git 1.8.0 for "merge-base --is-ancestor". Writing V2 repositories requires git 2.6 for "get-mark" support, so mask out tests for older gits.
Diffstat (limited to 't/import.t')
-rw-r--r-- | t/import.t | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -11,6 +11,7 @@ use IO::File; use Fcntl qw(:DEFAULT); use File::Temp qw/tempdir tempfile/; my $dir = tempdir('pi-import-XXXXXX', TMPDIR => 1, CLEANUP => 1); +require './t/common.perl'; is(system(qw(git init -q --bare), $dir), 0, 'git init successful'); my $git = PublicInbox::Git->new($dir); @@ -27,11 +28,12 @@ my $mime = PublicInbox::MIME->create( ], body => "hello world\n", ); +my $v2 = require_git(2.6, 1); -$im->{want_object_info} = 1 if 'v2'; +$im->{want_object_info} = 1 if $v2; like($im->add($mime), qr/\A:\d+\z/, 'added one message'); -if ('v2') { +if ($v2) { my $info = $im->{last_object}; like($info->[0], qr/\A[a-f0-9]{40}\z/, 'got last object_id'); is($mime->as_string, ${$info->[2]}, 'string matches'); |