Function: projectile--git-common-dir

projectile--git-common-dir is a byte-compiled function defined in projectile.el.

Signature

(projectile--git-common-dir GIT-DIR)

Documentation

Return the directory GIT-DIR shares with the repository's other checkouts.

A linked worktree's git directory carries a commondir file naming that shared directory; the main checkout's git directory is the shared directory itself.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile--git-common-dir (git-dir)
  "Return the directory GIT-DIR shares with the repository's other checkouts.

A linked worktree's git directory carries a `commondir' file naming that
shared directory; the main checkout's git directory is the shared
directory itself."
  (if-let* ((common (projectile--file-contents-trimmed
                     (expand-file-name "commondir" git-dir))))
      (file-name-as-directory (expand-file-name common git-dir))
    git-dir))