>From 2c3ed85f857759458130a7b707d9b6f4d2c1ef20 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Thu, 15 Jun 2023 16:45:48 -0400 Subject: [PATCH] Make project-root for vc projects return an absolute path Before this, if a vc project was in the user's home directory, project-root would be "~/some/path". This violates the spec of project-root, which requires an absolute path. One concrete bug caused by this is that (project-forget-project "~/some/path") would work but (project-forget-project "/home/user/some/path") would not. * lisp/progmodes/project.el (project-try-vc): Expand root directory before returning project. --- lisp/progmodes/project.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 2cffc1c0669..72cdb94bce4 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -689,7 +689,7 @@ project-try-vc (let* ((parent (file-name-directory (directory-file-name root)))) (setq root (vc-call-backend 'Git 'root parent)))) (when root - (setq project (list 'vc backend root)) + (setq project (list 'vc backend (expand-file-name root))) ;; FIXME: Cache for a shorter time. (vc-file-setprop dir 'project-vc project) project)))) -- 2.39.3