From 2e4e651b722673439be2654c7aae4202e8e73cd4 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Fri, 12 Nov 2021 10:46:56 +0100 Subject: [PATCH] Find most specific backend for `vc-backend-for-registration'. --- lisp/vc/vc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 4b56f1b795..b8f0425393 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -945,7 +945,7 @@ vc-backend-for-registration (dolist (backend vc-handled-backends) (when (not (vc-call-backend backend 'registered file)) (let* ((path (vc-call-backend backend 'responsible-p file)) - (len (length path))) + (len (and path (length (file-name-split path))))) (when (and len (> len max)) (setq max len bk backend))))) (when bk -- 2.33.1