diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index af875e89907f..db9b0db39c6b 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -962,11 +962,13 @@ vc-responsible-backend responsible for FILE is returned." (or (and (not (file-directory-p file)) (vc-backend file)) (catch 'found - ;; First try: find a responsible backend. If this is for registration, - ;; it must be a backend under which FILE is not yet registered. - (dolist (backend vc-handled-backends) - (and (vc-call-backend backend 'responsible-p file) - (throw 'found backend)))) + ;; First try: find a responsible backend. If this is for + ;; registration, it must be a backend under which FILE is not + ;; yet registered. + (dolist (file-path (list file (file-truename file))) + (dolist (backend vc-handled-backends) + (and (vc-call-backend backend 'responsible-p file-path) + (throw 'found backend))))) (error "No VC backend is responsible for %s" file))) (defun vc-expand-dirs (file-or-dir-list backend)