unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] searchidx: skip "delta $N" sections for base-85
@ 2022-07-19  2:36 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2022-07-19  2:36 UTC (permalink / raw)
  To: meta

I don't deal with binary patches ever, so I failed to notice
binary deltas are supported in addition to the more common
literals.

A quick check of apply.c in git.git confirms "delta" and
"literal" are the only binary patch classes we can expect.
---
 lib/PublicInbox/SearchIdx.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index cbfe7816..bdb84fc7 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -263,10 +263,10 @@ sub index_diff ($$$) {
 	while (defined($_ = shift @l)) {
 		if ($in_diff && /^GIT binary patch/) {
 			push @$xnq, $_;
-			while (@l && $l[0] =~ /^literal /) {
+			while (@l && $l[0] =~ /^(?:literal|delta) /) {
 				# TODO allow searching by size range?
 				# allows searching by exact size via:
-				# "literal $SIZE"
+				# "literal $SIZE" or "delta $SIZE"
 				push @$xnq, shift(@l);
 
 				# skip base85 and empty lines

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-19  2:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19  2:36 [PATCH] searchidx: skip "delta $N" sections for base-85 Eric Wong

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).