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/RepoTree.pm | |
parent | cf3df165033bf36631bd890fa2375339cd95c593 (diff) | |
download | public-inbox-39c390da4f5793bdd08a3634ca34ed9c9bda0700.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/RepoTree.pm')
-rw-r--r-- | lib/PublicInbox/RepoTree.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/RepoTree.pm b/lib/PublicInbox/RepoTree.pm index 5c73531a..4c85f9a8 100644 --- a/lib/PublicInbox/RepoTree.pm +++ b/lib/PublicInbox/RepoTree.pm @@ -51,8 +51,8 @@ sub find_missing { $res->[0] = 404; return delete($ctx->{-wcb})->($res); } - my $cmd = ['git', "--git-dir=$ctx->{git}->{git_dir}", - qw(log --no-color -1), '--pretty=%H %h %s (%as)' ]; + my $cmd = $ctx->{git}->cmd(qw(log --no-color -1), + '--pretty=%H %h %s (%as)'); push @$cmd, $ctx->{qp}->{h} if defined($ctx->{qp}->{h}); push @$cmd, '--'; push @$cmd, $ctx->{-path}; |