* 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).
"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