Function: projectile--git
projectile--git is a byte-compiled function defined in projectile.el.
Signature
(projectile--git ROOT &rest ARGS)
Documentation
Run git with ARGS in ROOT and return its output, or nil when it fails.
No shell is involved, and the call would go through TRAMP for a remote ROOT - which is why the callers make sure never to reach here with one.
--no-optional-locks keeps a dashboard opened on project switch from
taking the index lock and rewriting the index behind the user's back.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
;;; Git helpers
;;
;; Reading git for things other than the file listing: which files differ,
;; which branch a checkout is on, where the repository's shared directory
;; is. These are consumed by the repository identity, the worktree lookup,
;; the dashboard and `projectile-find-changed-file' alike, which is why they
;; live next to the VCS detection rather than inside any one of them.
(defun projectile--git (root &rest args)
"Run git with ARGS in ROOT and return its output, or nil when it fails.
No shell is involved, and the call would go through TRAMP for a remote
ROOT - which is why the callers make sure never to reach here with one.
`--no-optional-locks' keeps a dashboard opened on project switch from
taking the index lock and rewriting the index behind the user's back."
(let ((default-directory root))
(with-temp-buffer
(when (eql 0 (ignore-errors
(apply #'process-file "git" nil '(t nil) nil
"--no-optional-locks" args)))
(buffer-string)))))