about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-05-05 10:46:38 +0000
committerEric Wong <e@80x24.org>2021-05-05 17:45:17 +0000
commit18a0f22e6755af7b283b91722e9e9e649ec9d345 (patch)
tree39c037407a4f1b182faeb4ff6d7d92f8da29429f /lib
parentcf0c7ce3ce81b5c33cb149a7edc3efd99631a57d (diff)
downloadpublic-inbox-18a0f22e6755af7b283b91722e9e9e649ec9d345.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/LeiSearch.pm10
1 files changed, 10 insertions, 0 deletions
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;