]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix submodules, second try
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 15 May 2020 21:06:39 +0000 (00:06 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 15 May 2020 21:06:55 +0000 (00:06 +0300)
* lisp/progmodes/project.el (project-try-vc):
Call the backend directly instead of binding default-directory.

lisp/progmodes/project.el

index faa60d123fb4d153ba92a48d46c8e227f9d71c42..0ce2786a4dddac006a7d91713f7e1c8093b5a359 100644 (file)
@@ -274,8 +274,7 @@ backend implementation of `project-external-roots'.")
             ('Git
              ;; Don't stop at submodule boundary.
              (or (vc-file-getprop dir 'project-git-root)
-                 (let* ((default-directory dir)
-                        (root (vc-root-dir))
+                 (let* ((root (vc-call-backend backend 'root dir))
                         (gitfile (expand-file-name ".git" root)))
                    (vc-file-setprop
                     dir 'project-git-root
@@ -287,9 +286,8 @@ backend implementation of `project-external-roots'.")
                         (goto-char (point-min))
                         (looking-at "gitdir: [./]+/\.git/modules/"))
                       (let* ((parent (file-name-directory
-                                      (directory-file-name root)))
-                             (default-directory parent))
-                        (vc-root-dir)))
+                                      (directory-file-name root))))
+                        (vc-call-backend backend 'root parent)))
                      (t root)))
                    )))
             ('nil nil)