diff options
| author | Dmitry Gutov | 2020-05-18 02:46:06 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2020-05-18 02:52:54 +0300 |
| commit | 94f01fe206b554df94f7860892088cd22ed191dd (patch) | |
| tree | 7e180461d96da54fd4da7db342febd2a71d9c851 | |
| parent | 00be23c2af4aa1bb09afc6404c5ef68997dc18f5 (diff) | |
| download | emacs-94f01fe206b554df94f7860892088cd22ed191dd.tar.gz 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).
| -rw-r--r-- | lisp/vc/vc-hooks.el | 2 |
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: | |||
| 498 | "Return the repository version from which FILE was checked out. | 498 | "Return the repository version from which FILE was checked out. |
| 499 | If FILE is not registered, this function always returns nil." | 499 | If FILE is not registered, this function always returns nil." |
| 500 | (or (vc-file-getprop file 'vc-working-revision) | 500 | (or (vc-file-getprop file 'vc-working-revision) |
| 501 | (progn | 501 | (let ((default-directory (file-name-directory file))) |
| 502 | (setq backend (or backend (vc-backend file))) | 502 | (setq backend (or backend (vc-backend file))) |
| 503 | (when backend | 503 | (when backend |
| 504 | (vc-file-setprop file 'vc-working-revision | 504 | (vc-file-setprop file 'vc-working-revision |