[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Breakage by commit "779bc886f9 * Improve detection of Git submodules
From: |
Dmitry Gutov |
Subject: |
Re: Breakage by commit "779bc886f9 * Improve detection of Git submodules" |
Date: |
Sat, 16 May 2020 00:03:53 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 15.05.2020 22:45, Tassilo Horn wrote:
I've edebugged, and the problem is that
(let ((default-directory "~/Repos/el/emacs/lisp/net"))
(vc-root-dir)) ;=> nil
That's because `vc-deduce-backend' returns nil. It only looks at
default-directory when in dired-mode, shell-mode, or compilation-mode...
Oh, okay. Sorry about that.
Does this patch fix the situation?
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index faa60d123f..0ce2786a4d 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -274,8 +274,7 @@ project-try-vc
('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 @@ project-try-vc
(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)