+magit/clone: fix void-function ghub--username
This commit is contained in:
parent
ecfe52f71c
commit
7f1c275d62
1 changed files with 14 additions and 11 deletions
|
@ -98,19 +98,22 @@ control in buffers."
|
||||||
+ REPO: assumes {`+magit-default-clone-url'}/{USER}/REPO, where {USER} is
|
+ REPO: assumes {`+magit-default-clone-url'}/{USER}/REPO, where {USER} is
|
||||||
ascertained from your global gitconfig."
|
ascertained from your global gitconfig."
|
||||||
(interactive
|
(interactive
|
||||||
(let* ((user (ghub--username (ghub--host)))
|
(progn
|
||||||
(repo (read-from-minibuffer
|
(require 'ghub)
|
||||||
"Clone repository (user/repo or url): "
|
(let* ((user (ghub--username (ghub--host)))
|
||||||
(if user (concat user "/"))
|
(repo (read-from-minibuffer
|
||||||
nil nil '+magit-clone-history))
|
"Clone repository (user/repo or url): "
|
||||||
(name (car (last (split-string repo "/" t)))))
|
(if user (concat user "/"))
|
||||||
(list repo
|
nil nil '+magit-clone-history))
|
||||||
(read-directory-name
|
(name (car (last (split-string repo "/" t)))))
|
||||||
"Destination: "
|
(list repo
|
||||||
magit-clone-default-directory
|
(read-directory-name
|
||||||
name nil name))))
|
"Destination: "
|
||||||
|
magit-clone-default-directory
|
||||||
|
name nil name)))))
|
||||||
(magit-clone
|
(magit-clone
|
||||||
(cond ((string-match-p "^[^/]+$" url-or-repo)
|
(cond ((string-match-p "^[^/]+$" url-or-repo)
|
||||||
|
(require 'ghub)
|
||||||
(format +magit-default-clone-url (ghub--username (ghub--host)) url-or-repo))
|
(format +magit-default-clone-url (ghub--username (ghub--host)) url-or-repo))
|
||||||
((string-match-p "^\\([^/]+\\)/\\([^/]+\\)/?$" url-or-repo)
|
((string-match-p "^\\([^/]+\\)/\\([^/]+\\)/?$" url-or-repo)
|
||||||
(apply #'format +magit-default-clone-url (split-string url-or-repo "/" t)))
|
(apply #'format +magit-default-clone-url (split-string url-or-repo "/" t)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue