mirror of
https://github.com/NinjaTrappeur/my-repo-pins.git
synced 2024-06-02 03:24:09 +02:00
h-clone-project: full url clone
When the user queries a full git URL, directly clone the said URL instead of querying the upstream forges.
This commit is contained in:
parent
d3b80e7a51
commit
ab2431b750
13
h.el
13
h.el
|
@ -556,14 +556,21 @@ TODO: split that mess before release. We shouldn't query here."
|
|||
(h--update-forges-state ,forge-str new-state))))))))
|
||||
relevant-forges))
|
||||
((equal repo-query-kind 'repo) (error (format "Can't checkout %s (for now), please specify a owner" repo-query)))
|
||||
((equal repo-query-kind 'full-url) (error "TODO: Can't checkout a full URL (for now)"))
|
||||
(t (error repo-query-kind)))))
|
||||
((equal repo-query-kind 'full-url)
|
||||
(let*
|
||||
((code-root (h--safe-get-code-root))
|
||||
(dest-dir (concat code-root (h--filepath-from-clone-url repo-query))))
|
||||
(progn
|
||||
(h--git-clone-in-dir repo-query dest-dir)
|
||||
(find-file dest-dir))))
|
||||
(t (error repo-query-kind)))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Interactive Commands
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun h-checkout-project (user-query)
|
||||
(defun h-clone-project (user-query)
|
||||
"Clone USER-QUERY in its appropriate directory in ‘h-code-root’."
|
||||
(interactive "sGit repository to checkout: ")
|
||||
(progn
|
||||
(setq h--forge-fetchers-state nil)
|
||||
|
|
Loading…
Reference in a new issue