mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
vc-dir-recompute-file-state: Change directory to DEF-DIR
* lisp/vc/vc-dir.el (vc-dir-recompute-file-state): Change directory to DEF-DIR before calling into the backend. * test/lisp/vc/vc-tests/vc-test-misc.el (vc-test-vc-dir-on-symlink): Test that the file has the right state.
This commit is contained in:
parent
47bdbc8d85
commit
cd84bd6a0c
2 changed files with 8 additions and 6 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue