diff options
author | Eric Wong <e@80x24.org> | 2024-05-09 00:39:01 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2024-05-09 03:08:01 +0000 |
commit | 39c390da4f5793bdd08a3634ca34ed9c9bda0700 (patch) | |
tree | 75d879b15388519020222eeff485a479469513ac /lib/PublicInbox/SearchIdx.pm | |
parent | cf3df165033bf36631bd890fa2375339cd95c593 (diff) | |
download | public-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/SearchIdx.pm')
-rw-r--r-- | lib/PublicInbox/SearchIdx.pm | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index d3a7a0c0..4fd493d9 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -1003,8 +1003,7 @@ sub prepare_stack ($$) { sub is_ancestor ($$$) { my ($git, $cur, $tip) = @_; return 0 unless $git->check($cur); - my $cmd = [ 'git', "--git-dir=$git->{git_dir}", - qw(merge-base --is-ancestor), $cur, $tip ]; + my $cmd = $git->cmd(qw(merge-base --is-ancestor), $cur, $tip); run_wait($cmd) == 0; } |