X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FSearchIdx.pm;h=f03e290eb7eb60becb62d32fddfaa5f7e9672579;hb=9aa510cd3c4563b375ca4fc9a821db832ab88081;hp=f14809d25fe361a827dc3f18a21e14a594594f2b;hpb=55b707d788ce13696e4411389583e720ea6dab01;p=public-inbox.git diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index f14809d2..f03e290e 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -34,7 +34,7 @@ sub new { ref $ibx or die "BUG: expected PublicInbox::Inbox object: $ibx"; my $levels = qr/\A(?:full|medium|basic)\z/; my $inboxdir = $ibx->{inboxdir}; - my $version = $ibx->{version} || 1; + my $version = $ibx->version; my $indexlevel = 'full'; my $altid = $ibx->{altid}; if ($altid) { @@ -54,7 +54,7 @@ sub new { -inbox => $ibx, git => $ibx->git, -altid => $altid, - version => $version, + ibx_ver => $version, indexlevel => $indexlevel, }, $class; $ibx->umask_prepare; @@ -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+)$/) { @@ -358,7 +354,7 @@ sub add_xapian ($$$$$$) { sub _msgmap_init ($) { my ($self) = @_; - die "BUG: _msgmap_init is only for v1\n" if $self->{version} != 1; + die "BUG: _msgmap_init is only for v1\n" if $self->{ibx_ver} != 1; $self->{mm} //= eval { require PublicInbox::Msgmap; PublicInbox::Msgmap->new($self->{inboxdir}, 1); @@ -666,7 +662,6 @@ sub is_ancestor ($$$) { my $cmd = [ 'git', "--git-dir=$git->{git_dir}", qw(merge-base --is-ancestor), $cur, $tip ]; my $pid = spawn($cmd); - defined $pid or die "spawning ".join(' ', @$cmd)." failed: $!"; waitpid($pid, 0) == $pid or die join(' ', @$cmd) .' did not finish'; $? == 0; }