about summary refs log tree commit homepage
path: root/lib/PublicInbox/ExtSearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2024-05-09 00:39:01 +0000
committerEric Wong <e@80x24.org>2024-05-09 03:08:01 +0000
commit39c390da4f5793bdd08a3634ca34ed9c9bda0700 (patch)
tree75d879b15388519020222eeff485a479469513ac /lib/PublicInbox/ExtSearchIdx.pm
parentcf3df165033bf36631bd890fa2375339cd95c593 (diff)
downloadpublic-inbox-master.tar.gz
Repeatedly checking $PATH for `git' when we need to call it
multiple times in quick succession doesn't seem useful.  So
avoid some expensive stat(2) syscalls to make things less bad
for systems which require expensive CPU vulnerability
mitigations.

This also saves a bunch of memory allocations since we do the
$PATH lookup in pure Perl to avoid doing the uncacheable lookup
in a vfork-ed child.
Diffstat (limited to 'lib/PublicInbox/ExtSearchIdx.pm')
-rw-r--r--lib/PublicInbox/ExtSearchIdx.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index 774fa47b..883dbea3 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -1288,10 +1288,10 @@ sub idx_init { # similar to V2Writable
                 $self->{mg}->write_alternates($mode, $alt, $new);
         my $restore = $self->with_umask;
         if ($git_midx && ($opt->{'multi-pack-index'} // 1)) {
-                my @cmd = ('multi-pack-index');
-                push @cmd, '--no-progress' if ($opt->{quiet}//0) > 1;
+                my $cmd = $self->git->cmd('multi-pack-index');
+                push @$cmd, '--no-progress' if ($opt->{quiet}//0) > 1;
                 my $lk = $self->lock_for_scope;
-                system('git', "--git-dir=$ALL", @cmd, 'write');
+                system(@$cmd, 'write');
                 # ignore errors, fairly new command, may not exist
         }
         $self->parallel_init($self->{indexlevel});