From: Dmitry Gutov Date: Sun, 17 May 2020 23:46:06 +0000 (+0300) Subject: vc-working-revision: Bind default-directory X-Git-Tag: emacs-28.0.90~7333 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=94f01fe206b554df94f7860892088cd22ed191dd;p=emacs.git 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). --- 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