]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei_remote: solver supports uncommitted blobs
authorEric Wong <e@80x24.org>
Fri, 12 Apr 2024 18:04:12 +0000 (18:04 +0000)
committerEric Wong <e@80x24.org>
Sat, 13 Apr 2024 10:06:13 +0000 (10:06 +0000)
This should improve `lei blob' and `lei rediff' functionality
for folks relying on `lei index' and allows future work to
improve parallelism via checkpointing in lei/store.

lib/PublicInbox/LeiRemote.pm

index 559fb8d51e409a8a0e6386b6021dc024a24a4f55..ddcaf2c9ae4faaa15a04ccc75e09a7ef16a5c46d 100644 (file)
@@ -67,9 +67,16 @@ sub base_url { "$_[0]->{uri}" }
 
 sub smsg_eml {
        my ($self, $smsg) = @_;
-       if (my $bref = $self->{lei}->ale->git->cat_file($smsg->{blob})) {
-               return PublicInbox::Eml->new($bref);
-       }
+       my $bref = $self->{lei}->ale->git->cat_file($smsg->{blob}) // do {
+               my $lms = $self->{lei}->lms;
+               ($lms ? $lms->local_blob($smsg->{blob}, 1) : undef) // do {
+                       my $sto = $self->{lei}->{sto} //
+                                       $self->{lei}->_lei_store;
+                       $sto && $sto->{-wq_s1} ?
+                               $sto->wq_do('cat_blob', $smsg->{blob}) : undef;
+               }
+       };
+       return PublicInbox::Eml->new($bref) if $bref;
        warn("E: $self->{uri} $smsg->{blob} gone <$smsg->{mid}>\n");
        undef;
 }