about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-01-25 04:45:05 +0000
committerEric Wong <e@yhbt.net>2020-01-27 02:59:09 +0000
commit9aa510cd3c4563b375ca4fc9a821db832ab88081 (patch)
treed9fb1354a43347ff93f2cb2d08db3c9ff94ab13a /lib
parent02cdbe1c1638ba8e80351b39029c08343fab018b (diff)
downloadpublic-inbox-9aa510cd3c4563b375ca4fc9a821db832ab88081.tar.gz
We already capture filenames on the lines beginning
with "---" and "+++", so it's redundant work to capture
filenames from "diff --git ..." lines.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/SearchIdx.pm8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 4349d127..f03e290e 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -209,12 +209,8 @@ sub index_diff ($$$) {
                         index_diff_inc($self, $_, 'XDFCTX', $xnq);
                 } elsif (/^-- $/) { # email signature begins
                         $in_diff = undef;
-                } elsif (m!^diff --git ("?a/.+) ("?b/.+)\z!) {
-                        my ($fa, $fb) = ($1, $2);
-                        my $fn = (split('/', git_unquote($fa), 2))[1];
-                        $seen{$fn}++ or index_diff_inc($self, $fn, 'XDFN', $xnq);
-                        $fn = (split('/', git_unquote($fb), 2))[1];
-                        $seen{$fn}++ or index_diff_inc($self, $fn, 'XDFN', $xnq);
+                } elsif (m!^diff --git "?[^/]+/.+ "?[^/]+/.+\z!) {
+                        # wait until "---" and "+++" to capture filenames
                         $in_diff = 1;
                 # traditional diff:
                 } elsif (m/^diff -(.+) (\S+) (\S+)$/) {