diff options
author | Eric Wong <e@80x24.org> | 2020-01-03 08:45:58 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-01-04 09:34:47 +0000 |
commit | 28bfb760619eb4225b469df900d14fb70741604d (patch) | |
tree | b4169767087d9e57dd0cf0d05005f3964296512b | |
parent | aa1e96cd44f6d5cd77a96648ac1f2dbcca9dc367 (diff) | |
download | public-inbox-28bfb760619eb4225b469df900d14fb70741604d.tar.gz |
As discovered by solver bug hunting, "git apply" also handles the case where blank lines w/o leading space are treated as diff context, apparently because GNU diff once did it: https://public-inbox.org/git/b507b465f7831612b9d9fc643e3e5218b64e5bfa/s/
-rw-r--r-- | lib/PublicInbox/SearchIdx.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 21ab8119..4cfbc4aa 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -255,7 +255,9 @@ sub index_diff ($$$) { /^Binary files .* differ/) { push @xnq, $_; } elsif ($_ eq '') { - $in_diff = undef; + # possible to be in diff context, some mail may be + # stripped by MUA or even GNU diff(1). "git apply" + # treats a bare "\n" as diff context, too } else { push @xnq, $_; warn "non-diff line: $_\n" if DEBUG && $_ ne ''; |