git: reduce spawning for rev-parse --git-pathmaster
commitf8937f45d74d07fc6d7723d8b2fc3ba1aed7624b
authorEric Wong <e@80x24.org>
Thu, 30 May 2024 09:45:15 +0000 (30 09:45 +0000)
committerEric Wong <e@80x24.org>
Fri, 31 May 2024 03:18:53 +0000 (31 03:18 +0000)
treef3429649e7620ce6fc8c63b3d327b8f7c5d2a045
parent7ea9bda92fe0565ab563763d9365e76cd0c24ea7
git: reduce spawning for rev-parse --git-path

Since every non-worktree git repo has an `objects' directory, we
can quickly stat(2) to check for its presence and avoid an
expensive process spawn.  This should be the common case on
servers since it's rare to use worktrees on servers for
coderepos (or inboxes).
lib/PublicInbox/Git.pm