treewide: reduce $PATH checks for `git' executable
commit39c390da4f5793bdd08a3634ca34ed9c9bda0700
authorEric Wong <e@80x24.org>
Thu, 9 May 2024 00:39:01 +0000 (9 00:39 +0000)
committerEric Wong <e@80x24.org>
Thu, 9 May 2024 03:08:01 +0000 (9 03:08 +0000)
tree75d879b15388519020222eeff485a479469513ac
parentcf3df165033bf36631bd890fa2375339cd95c593
treewide: reduce $PATH checks for `git' executable

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.
15 files changed:
lib/PublicInbox/Config.pm
lib/PublicInbox/ExtSearchIdx.pm
lib/PublicInbox/Fetch.pm
lib/PublicInbox/Git.pm
lib/PublicInbox/Import.pm
lib/PublicInbox/LeiBlob.pm
lib/PublicInbox/LeiMirror.pm
lib/PublicInbox/LeiRediff.pm
lib/PublicInbox/RepoAtom.pm
lib/PublicInbox/RepoSnapshot.pm
lib/PublicInbox/RepoTree.pm
lib/PublicInbox/SearchIdx.pm
lib/PublicInbox/TestCommon.pm
lib/PublicInbox/V2Writable.pm
lib/PublicInbox/ViewVCS.pm