vc-checkout: Try to use the vc-dir's backend first

* lisp/vc/vc.el (vc-checkout): Try to use the vc-dir's backend
before looking for the file's one.  The latter doesn't work when
the file doesn't exist on disk yet (bug#62674).
This commit is contained in:
Dmitry Gutov 2023-04-11 22:59:45 +03:00
parent 372e024acc
commit e9fef1d70f

View file

@ -1594,7 +1594,7 @@ After check-out, runs the normal hook `vc-checkout-hook'."
(vc-call make-version-backups-p file)
(vc-up-to-date-p file)
(vc-make-version-backup file))
(let ((backend (vc-backend file)))
(let ((backend (or vc-dir-backend (vc-backend file))))
(with-vc-properties (list file)
(condition-case err
(vc-call-backend backend 'checkout file rev)