From 18a0f22e6755af7b283b91722e9e9e649ec9d345 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 May 2021 10:46:38 +0000 Subject: lei blob: support "lei index"-ed mail Normal git retrieval don't work for Maildir blobs indexed using "lei index". Fortunately, this oddness is limited to the LeiStore class and we can override smsg_eml with a fallback to read blobs from Maildirs. --- lib/PublicInbox/LeiSearch.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/PublicInbox/LeiSearch.pm') diff --git a/lib/PublicInbox/LeiSearch.pm b/lib/PublicInbox/LeiSearch.pm index cd28a700..c2b12146 100644 --- a/lib/PublicInbox/LeiSearch.pm +++ b/lib/PublicInbox/LeiSearch.pm @@ -144,4 +144,14 @@ sub lms { -f $f ? PublicInbox::LeiMailSync->new($f) : undef; } +# allow SolverGit->resolve_patch to work with "lei index" +sub smsg_eml { + my ($self, $smsg) = @_; + PublicInbox::Inbox::smsg_eml($self, $smsg) // do { + my $lms = lms($self); + my $bref = $lms ? $lms->local_blob($smsg->{blob}, 1) : undef; + $bref ? PublicInbox::Eml->new($bref) : undef; + }; +} + 1; -- cgit v1.2.3-24-ge0c7