diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index f0f035362c9..7384cc81869 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1275,9 +1275,10 @@ that file." ;; FIXME: Warning: UGLY HACK. The CVS backend caches the state ;; info, this forces the backend to update it. (vc-call-backend vc-dir-backend 'registered fname)) - (let ((state (vc-call-backend vc-dir-backend 'state fname)) + (let ((default-directory def-dir) + (state (vc-call-backend vc-dir-backend 'state fname-short)) (extra (vc-call-backend vc-dir-backend - 'status-fileinfo-extra fname))) + 'status-fileinfo-extra fname-short))) ;; Ensure we return a nil state if the file does not exist and is ;; not tracked so that it disappears from VC-Dir (bug#81191). (if (and (eq state 'up-to-date) (not (file-exists-p fname))) diff --git a/test/lisp/vc/vc-tests/vc-test-misc.el b/test/lisp/vc/vc-tests/vc-test-misc.el index 853f22545a6..066c49df324 100644 --- a/test/lisp/vc/vc-tests/vc-test-misc.el +++ b/test/lisp/vc/vc-tests/vc-test-misc.el @@ -292,10 +292,11 @@ See bug#80803 and bug#80967." (basic-save-buffer)) (dolist (buf (list truename-dir symlink-dir)) (with-current-buffer buf - (should (equal (vc-dir-fileinfo->name - (ewoc-data - (ewoc-nth vc-ewoc 1))) - (file-name-nondirectory file)))))))))) + (let ((data (ewoc-data (ewoc-nth vc-ewoc 1)))) + (should (equal (vc-dir-fileinfo->name data) + (file-name-nondirectory file))) + (should (equal (vc-dir-fileinfo->state data) + 'edited)))))))))) (provide 'vc-test-misc) ;;; vc-test-misc.el ends here