[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 439a309: Find most specific backend for `vc-backend-for-registrat
From: |
Lars Ingebrigtsen |
Subject: |
master 439a309: Find most specific backend for `vc-backend-for-registration'. |
Date: |
Sat, 13 Nov 2021 19:54:51 -0500 (EST) |
branch: master
commit 439a3094ff7fd84d1b1a5c6f5eb87431eec0d7fd
Author: Manuel Giraud <manuel@ledu-giraud.fr>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Find most specific backend for `vc-backend-for-registration'.
* lisp/vc/vc.el (vc-backend-for-registration): Count file name
components instead of the length of the file name string (bug#50572).
---
lisp/vc/vc.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 4b56f1b..64f752f 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -944,8 +944,10 @@ use."
bk)
(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)))
+ (let* ((dir-name (vc-call-backend backend 'responsible-p file))
+ (len (and dir-name
+ (length (file-name-split
+ (expand-file-name dir-name))))))
(when (and len (> len max))
(setq max len bk backend)))))
(when bk
@@ -977,7 +979,7 @@ use."
(message "arg %s" arg)
(and (file-directory-p arg)
(string-prefix-p (expand-file-name arg) def-dir)))))))
- (let ((default-directory repo-dir))
+ (let ((default-directory repo-dir))
(vc-call-backend bk 'create-repo))
(throw 'found bk))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 439a309: Find most specific backend for `vc-backend-for-registration'.,
Lars Ingebrigtsen <=