# needed for alternates, and --absolute-git-dir is only in git 2.13+
$git_dir = abs_path($git_dir);
-use_ok "PublicInbox::$_" for (qw(Inbox V2Writable MIME Git SolverGit WWW));
+use_ok "PublicInbox::$_" for (qw(Inbox V2Writable Git SolverGit WWW));
my ($inboxdir, $for_destroy) = tmpdir();
my $opts = {
$im->{parallel} = 0;
my $deliver_patch = sub ($) {
- my $mime = PublicInbox::InboxWritable::mime_from_path($_[0]) or
- die "open $_[0]: $!";
- $im->add($mime);
+ $im->add(eml_load($_[0]));
$im->done;
};
$deliver_patch->('t/solve/0001-simple-mod.patch');
my $v1_0_0_tag = 'cb7c42b1e15577ed2215356a2bf925aef59cdd8d';
+my $v1_0_0_tag_short = substr($v1_0_0_tag, 0, 16);
my $git = PublicInbox::Git->new($git_dir);
$ibx->{-repo_objs} = [ $git ];
my $res;
my $solver = PublicInbox::SolverGit->new($ibx, sub { $res = $_[0] });
open my $log, '+>>', "$inboxdir/solve.log" or die "open: $!";
-my $psgi_env = { 'psgi.errors' => *STDERR, 'psgi.url_scheme' => 'http',
+my $psgi_env = { 'psgi.errors' => \*STDERR, 'psgi.url_scheme' => 'http',
'HTTP_HOST' => 'example.com' };
$solver->solve($psgi_env, $log, '69df7d5', {});
ok($res, 'solved a blob!');
is($res->code, 404, 'failure with null OID');
$res = $cb->(GET("/$name/$v1_0_0_tag/s/"));
- is($res->code, 200, 'shows commit');
+ is($res->code, 200, 'shows commit (unabbreviated)');
+ $res = $cb->(GET("/$name/$v1_0_0_tag_short/s/"));
+ is($res->code, 200, 'shows commit (abbreviated)');
while (my ($label, $size) = each %bin) {
$res = $cb->(GET("/$name/$oid{$label}/s/"));
is($res->code, 200, "$label binary file");