From 94f01fe206b554df94f7860892088cd22ed191dd Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 18 May 2020 02:46:06 +0300 Subject: [PATCH] vc-working-revision: Bind default-directory * lisp/vc/vc-hooks.el (vc-working-revision): Bind default-directory to be on the safe side. Suggested by Ilya Ostapyshyn (https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg02301.html). --- lisp/vc/vc-hooks.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 2ca9d3e620c..ce72a49b955 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -498,7 +498,7 @@ status of this file. Otherwise, the value returned is one of: "Return the repository version from which FILE was checked out. If FILE is not registered, this function always returns nil." (or (vc-file-getprop file 'vc-working-revision) - (progn + (let ((default-directory (file-name-directory file))) (setq backend (or backend (vc-backend file))) (when backend (vc-file-setprop file 'vc-working-revision -- 2.39.5