summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-hooks.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2020-05-18 02:46:06 +0300
committerDmitry Gutov <dgutov@yandex.ru>2020-05-18 02:52:54 +0300
commit94f01fe206b554df94f7860892088cd22ed191dd (patch)
tree7e180461d96da54fd4da7db342febd2a71d9c851 /lisp/vc/vc-hooks.el
parent00be23c2af4aa1bb09afc6404c5ef68997dc18f5 (diff)
downloademacs-94f01fe206b554df94f7860892088cd22ed191dd.tar.gz
emacs-94f01fe206b554df94f7860892088cd22ed191dd.tar.bz2
emacs-94f01fe206b554df94f7860892088cd22ed191dd.zip
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).
Diffstat (limited to 'lisp/vc/vc-hooks.el')
-rw-r--r--lisp/vc/vc-hooks.el2
1 files changed, 1 insertions, 1 deletions
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