]> git.eshelyaron.com Git - emacs.git/commitdiff
vc-working-revision: Bind default-directory
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 17 May 2020 23:46:06 +0000 (02:46 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 17 May 2020 23:52:54 +0000 (02:52 +0300)
* 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

index 2ca9d3e620c4675c6547b55e64e28a0d8d82c611..ce72a49b955c39630663fb3121a9fa6a01d0a0e8 100644 (file)
@@ -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