X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FSolverGit.pm;h=38fba0ca79340eb655c12a319ab28d54621644fa;hb=refs%2Fheads%2Fmaster;hp=b723b48a9f6545ef7724b5605666a53ab3d7b361;hpb=66eb1f1d9d7eb8fe892e328f6a5e656d1df7836b;p=public-inbox.git diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm index b723b48a..38fba0ca 100644 --- a/lib/PublicInbox/SolverGit.pm +++ b/lib/PublicInbox/SolverGit.pm @@ -82,7 +82,7 @@ sub solve_existing ($$) { my ($oid_full, $type, $size) = $git->check($oid_b); if ($oid_b eq ($oid_full // '') || (defined($type) && -- (!$self->{have_hints} || $type eq 'blob'))) { + (!$self->{have_hints} || $type eq 'blob'))) { delete $want->{try_gits}; return [ $git, $oid_full, $type, int($size) ]; # done, success } @@ -465,6 +465,7 @@ sub apply_result ($$) { dbg($self, 'trying '.di_url($self, $nxt)); return do_git_apply($self); } else { + $msg .= " (no patches left to try for $di->{oid_b})\n"; ERR($self, $msg); } } else { @@ -639,7 +640,7 @@ sub resolve_patch ($$) { # scan through inboxes to look for emails which results in # the oid we want: - my $ibx = shift(@{$want->{try_ibxs}}) or die 'BUG: {try_ibxs} empty'; + my $ibx = shift(@{$want->{try_ibxs}}) or return done($self, undef); if (my $msgs = find_smsgs($self, $ibx, $want)) { $want->{try_smsgs} = $msgs; $want->{cur_ibx} = $ibx; @@ -654,14 +655,14 @@ sub resolve_patch ($$) { sub new { my ($class, $ibx, $user_cb, $uarg) = @_; - bless { - gits => $ibx->{-repo_objs}, + bless { # $ibx is undef if coderepo only (see WwwCoderepo) + gits => $ibx ? $ibx->{-repo_objs} : undef, user_cb => $user_cb, uarg => $uarg, # -cur_di, -qsp_err, -msg => temp fields for Qspawn callbacks # TODO: config option for searching related inboxes - inboxes => [ $ibx ], + inboxes => $ibx ? [ $ibx ] : [], }, $class; }