* [PATCH] lei blob: fix attachment extraction for unimported||inflight
@ 2024-04-11 18:58 7% Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2024-04-11 18:58 UTC (permalink / raw)
To: meta
Noticed while trying to make other reliability improvements to
lei...
---
lib/PublicInbox/LeiBlob.pm | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/PublicInbox/LeiBlob.pm b/lib/PublicInbox/LeiBlob.pm
index 127cc81e..00697097 100644
--- a/lib/PublicInbox/LeiBlob.pm
+++ b/lib/PublicInbox/LeiBlob.pm
@@ -119,14 +119,17 @@ sub lei_blob {
} else {
open $rdr->{2}, '>', '/dev/null' or die "open: $!";
}
- my $cmd = [ 'git', '--git-dir='.$lei->ale->git->{git_dir},
- 'cat-file', 'blob', $blob ];
+ my $cmd = $lei->ale->git->cmd('cat-file', 'blob', $blob);
+ my $cerr;
if (defined $lei->{-attach_idx}) {
my $buf = run_qx($cmd, $lei->{env}, $rdr);
return extract_attach($lei, $blob, \$buf) unless $?;
+ $cerr = $?;
+ } else {
+ $rdr->{1} = $lei->{1}; # write directly to client
+ $cerr = run_wait($cmd, $lei->{env}, $rdr) or return;
}
- $rdr->{1} = $lei->{1};
- my $cerr = run_wait($cmd, $lei->{env}, $rdr) or return;
+ # fall back to unimported ('lei index') and inflight blobs
my $lms = $lei->lms;
my $bref = ($lms ? $lms->local_blob($blob, 1) : undef) // do {
my $sto = $lei->{sto} // $lei->_lei_store;
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2024-04-11 18:58 7% [PATCH] lei blob: fix attachment extraction for unimported||inflight Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).