Merge pull request #12 from m-cat/support-git-worktrees

This commit is contained in:
Ninjatrappeur 2022-07-26 10:13:43 +02:00 committed by GitHub
commit f460f17c52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -474,7 +474,7 @@ If MAX-DEPTH is set to nil, do not use any recursion stop gap."
(let ((full-file (concat dir "/" file)))
;; Don't follow symlinks to other directories.
(when (not (file-symlink-p full-file))
(if (file-directory-p (concat full-file ".git"))
(if (my-repo-pins--is-git-dir full-file)
;; It's a git repo, let's stop here.
(setq projects (nconc projects (list full-file)))
;; It's not a git repo, let's recurse into it.
@ -502,6 +502,10 @@ If MAX-DEPTH is set to nil, do not use any recursion stop gap."
(recurse-in-dir dir 0)
(recurse-in-dir dir nil))))
(defun my-repo-pins--is-git-dir (dir)
"Return non-nil if DIR is a git directory."
(file-exists-p (concat (file-name-as-directory dir) ".git")))
(defun my-repo-pins--get-code-root-projects (code-root max-depth)
"Retrieve the projects contained in the CODE-ROOT directory.
We're going to make some hard assumptions about how the