diff options
author | Eric Wong <e@80x24.org> | 2021-08-14 00:29:44 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-08-14 05:57:47 +0000 |
commit | ea9b01fc63f864435370d3bc9cec674ce03e887e (patch) | |
tree | 68316244d55e7ce43442a0025da666ef7b4817ef /lib/PublicInbox/LeiStore.pm | |
parent | 7d576adffbbd61f04278937d882d7ffde570cecd (diff) | |
download | public-inbox-ea9b01fc63f864435370d3bc9cec674ce03e887e.tar.gz |
PublicInbox::Import never imports @UNWANTED_HEADERS, so ensure our mock blob OIDs do the same. This ought to prevent duplicates if the PSGI mboxrd download starts setting "X-Status: F" like "lei q -tt .."
Diffstat (limited to 'lib/PublicInbox/LeiStore.pm')
-rw-r--r-- | lib/PublicInbox/LeiStore.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index ce66014f..3f33d114 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -20,7 +20,7 @@ use PublicInbox::Eml; use PublicInbox::Import; use PublicInbox::InboxWritable qw(eml_from_path); use PublicInbox::V2Writable; -use PublicInbox::ContentHash qw(content_hash); +use PublicInbox::ContentHash qw(content_hash git_sha); use PublicInbox::MID qw(mids); use PublicInbox::LeiSearch; use PublicInbox::MDA; @@ -508,4 +508,11 @@ sub write_prepare { $lei->{sto} = $self; } +# TODO: support SHA-256 +sub git_blob_id { # called via LEI->git_blob_id + my ($self, $eml) = @_; + $eml->header_set($_) for @PublicInbox::Import::UNWANTED_HEADERS; + git_sha(1, $eml)->hexdigest; +} + 1; |