Function: projectile--jj-repo-identity

projectile--jj-repo-identity is a byte-compiled function defined in projectile.el.

Signature

(projectile--jj-repo-identity ROOT)

Documentation

Return the repository identity plist for the Jujutsu workspace at ROOT.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile--jj-repo-identity (root)
  "Return the repository identity plist for the Jujutsu workspace at ROOT."
  (when-let* ((repo-dir (projectile--jj-repo-dir root)))
    ;; A git-backed repository - which is every one `jj git init' makes -
    ;; names the git directory holding its commits, relative to the store
    ;; rather than to the repository.  Resolving to that instead of to
    ;; `.jj' makes a workspace and the colocated git checkout agree on
    ;; which repository they are, rather than each insisting on its own
    ;; answer, and it gets the remote for free.
    (let ((store (expand-file-name "store/" repo-dir)))
      (if-let* ((target (projectile--file-contents-trimmed
                         (expand-file-name "git_target" store)))
                (path (expand-file-name target store)))
          (projectile--git-dir-identity
           ;; The target is usually a git directory, but a submodule
           ;; checkout or a linked worktree has a `.git' *file* pointing at
           ;; the real one, and either can be a linked worktree's git
           ;; directory rather than the shared one.
           (projectile--git-common-dir
            (if (file-directory-p path)
                (file-name-as-directory path)
              (or (projectile--git-dir (file-name-directory path))
                  (file-name-as-directory path)))))
        (list :repo (file-truename repo-dir))))))