Merge pull request #1459 from qhuyduong/fix-magit-clone

Fix magit-clone error
This commit is contained in:
Henrik Lissner 2019-06-07 14:19:31 +02:00 committed by GitHub
commit 4f1090d099
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,14 +113,15 @@ control in buffers."
"Destination: " "Destination: "
magit-clone-default-directory magit-clone-default-directory
name nil name))))) name nil name)))))
(magit-clone (magit-clone-regular
(cond ((string-match-p "^[^/]+$" url-or-repo) (cond ((string-match-p "^[^/]+$" url-or-repo)
(require 'ghub) (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)))
(url-or-repo)) (url-or-repo))
dir)) dir
nil))
;; ;;