]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidx: index "diff --git a/... b/..." headers
authorEric Wong <e@80x24.org>
Mon, 8 Nov 2021 21:27:14 +0000 (21:27 +0000)
committerEric Wong <e@80x24.org>
Tue, 9 Nov 2021 00:43:30 +0000 (00:43 +0000)
While we do detailed indexing of git diffs, the header itself
was failing and queries like 'nq:diff' would not work.

Noticed-by: Rob Herring <robh@kernel.org>
lib/PublicInbox/SearchIdx.pm

index b886ce789b7943dfb5eb2c248bb62c6329e36acc..6e2e614c5085c7e45fa33ad06375a9137af1ee31 100644 (file)
@@ -259,6 +259,7 @@ sub index_diff ($$$) {
                } elsif (m!^diff --git "?[^/]+/.+ "?[^/]+/.+\z!) {
                        # wait until "---" and "+++" to capture filenames
                        $in_diff = 1;
                } elsif (m!^diff --git "?[^/]+/.+ "?[^/]+/.+\z!) {
                        # wait until "---" and "+++" to capture filenames
                        $in_diff = 1;
+                       push @xnq, $_;
                # traditional diff:
                } elsif (m/^diff -(.+) (\S+) (\S+)$/) {
                        my ($opt, $fa, $fb) = ($1, $2, $3);
                # traditional diff:
                } elsif (m/^diff -(.+) (\S+) (\S+)$/) {
                        my ($opt, $fa, $fb) = ($1, $2, $3);