aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Kaludercic2022-10-23 18:27:07 +0200
committerPhilip Kaludercic2022-10-23 18:27:07 +0200
commitca61e768d0d599657b4f8e998fb74eccee58c8f6 (patch)
treed72393330b8400c53e4773a30044d0e469e38efa
parentdbcd66371577efacef62419d1efa39494f4cd778 (diff)
downloademacs-ca61e768d0d599657b4f8e998fb74eccee58c8f6.tar.gz
emacs-ca61e768d0d599657b4f8e998fb74eccee58c8f6.zip
Use user option 'package-vc-default-backend' when cloning
* lisp/emacs-lisp/package-vc.el (package-vc-unpack): Respect 'package-vc-default-backend'.
-rw-r--r--lisp/emacs-lisp/package-vc.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 082e8f17f62..dd451e80f4b 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -102,10 +102,13 @@
102 :version "29.1") 102 :version "29.1")
103 103
104(defcustom package-vc-default-backend 'Git 104(defcustom package-vc-default-backend 'Git
105 "VC backend to use as a fallback." 105 "Default VC backend used when cloning a package repository.
106 :type `(choice 106If no repository type was specified or could be guessed by
107 ,@(mapcar (lambda (b) (list 'const b)) 107`package-vc-heusitic-alist', the VC backend denoted by this
108 vc-handled-backends)) 108symbol is used. The value must be a member of
109`vc-handled-backends' that implements the `clone' function."
110 :type `(choice ,@(mapcar (lambda (b) (list 'const b))
111 vc-handled-backends))
109 :version "29.1") 112 :version "29.1")
110 113
111(defvar package-vc-archive-spec-alist nil 114(defvar package-vc-archive-spec-alist nil
@@ -357,8 +360,9 @@ the `:brach' attribute in PKG-SPEC."
357 ;; Clone the repository into `repo-dir' if necessary 360 ;; Clone the repository into `repo-dir' if necessary
358 (unless (file-exists-p repo-dir) 361 (unless (file-exists-p repo-dir)
359 (make-directory (file-name-directory repo-dir) t) 362 (make-directory (file-name-directory repo-dir) t)
360 (let ((backend (and url (alist-get url package-vc-heusitic-alist 363 (let ((backend (or (and url (alist-get url package-vc-heusitic-alist
361 nil nil #'string-match-p)))) 364 nil nil #'string-match-p))
365 package-vc-default-backend)))
362 (unless (vc-clone url backend repo-dir (or rev branch)) 366 (unless (vc-clone url backend repo-dir (or rev branch))
363 (error "Failed to clone %s from %s" name url)))) 367 (error "Failed to clone %s from %s" name url))))
364 368