Function: projectile-worktrees-from-known-projects
projectile-worktrees-from-known-projects is a byte-compiled function
defined in projectile.el.
Signature
(projectile-worktrees-from-known-projects ROOT)
Documentation
Return the known projects that are checkouts of ROOT's repository.
This is how everything git can't enumerate gets found: a Mercurial working directory sharing another's store, and - the case that turns up far more often than the plumbing suggests - a second clone of the same upstream, which is the same workflow done by hand.
Only projects Projectile already knows about can be found this way, since there's nothing else to enumerate.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-worktrees-from-known-projects (root)
"Return the known projects that are checkouts of ROOT\\='s repository.
This is how everything git can\\='t enumerate gets found: a Mercurial
working directory sharing another\\='s store, and - the case that turns up
far more often than the plumbing suggests - a second clone of the same
upstream, which is the same workflow done by hand.
Only projects Projectile already knows about can be found this way, since
there\\='s nothing else to enumerate."
(when-let* ((identity (projectile-repo-identity root)))
(delq nil
(mapcar (lambda (project)
(let ((project (file-name-as-directory
(expand-file-name project))))
(when (and (not (file-remote-p project))
(file-directory-p project)
(not (projectile-ignored-project-p project))
(projectile-same-repo-p
identity (projectile-repo-identity project)))
(list :path project
:label (projectile--checkout-branch project)))))
(projectile-known-projects)))))