aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/project.el21
1 files changed, 18 insertions, 3 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index ca8b5fa84e0..eeff809e2a3 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1,7 +1,7 @@
1;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- 1;;; project.el --- Operations on the current project -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2015-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
4;; Version: 0.1 4;; Version: 0.1.1
5;; Package-Requires: ((emacs "26.3")) 5;; Package-Requires: ((emacs "26.3"))
6 6
7;; This is a GNU ELPA :core package. Avoid using functionality that 7;; This is a GNU ELPA :core package. Avoid using functionality that
@@ -274,8 +274,23 @@ backend implementation of `project-external-roots'.")
274 ('Git 274 ('Git
275 ;; Don't stop at submodule boundary. 275 ;; Don't stop at submodule boundary.
276 (or (vc-file-getprop dir 'project-git-root) 276 (or (vc-file-getprop dir 'project-git-root)
277 (vc-file-setprop dir 'project-git-root 277 (let* ((default-directory dir)
278 (vc-find-root dir ".git/")))) 278 (root (vc-root-dir)))
279 (vc-file-setprop
280 dir 'project-git-root
281 (cond
282 ((file-directory-p (expand-file-name ".git" root))
283 root)
284 ((with-temp-buffer
285 (insert-file-contents ".git")
286 (goto-char (point-min))
287 (looking-at "gitdir: [./]+/\.git/modules/"))
288 (let* ((parent (file-name-directory
289 (directory-file-name root)))
290 (default-directory parent))
291 (vc-root-dir)))
292 (t root)))
293 )))
279 ('nil nil) 294 ('nil nil)
280 (_ (ignore-errors (vc-call-backend backend 'root dir)))))) 295 (_ (ignore-errors (vc-call-backend backend 'root dir))))))
281 (and root (cons 'vc root)))) 296 (and root (cons 'vc root))))