Mercurial > kallithea
changeset 5190:c082a017b366
git: Allow git:// URLs as a source to clone from
author | Andrew Bartlett <abartlet@catalyst.net.nz> |
---|---|
date | Thu, 18 Jun 2015 14:54:35 +1200 |
parents | 329c0584cba8 |
children | 17281153a4c0 |
files | kallithea/lib/utils2.py kallithea/lib/vcs/backends/git/repository.py kallithea/model/validators.py |
diffstat | 3 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/lib/utils2.py Thu Jun 18 08:46:07 2015 +0200 +++ b/kallithea/lib/utils2.py Thu Jun 18 14:54:35 2015 +1200 @@ -469,7 +469,7 @@ proto = '' - for pat in ('https://', 'http://'): + for pat in ('https://', 'http://', 'git://'): if uri.startswith(pat): uri = uri[len(pat):] proto = pat
--- a/kallithea/lib/vcs/backends/git/repository.py Thu Jun 18 08:46:07 2015 +0200 +++ b/kallithea/lib/vcs/backends/git/repository.py Thu Jun 18 14:54:35 2015 +1200 @@ -174,6 +174,9 @@ if os.path.isdir(url) or url.startswith('file:'): return True + if url.startswith('git://'): + return True + if '+' in url[:url.find('://')]: url = url[url.find('+') + 1:]
--- a/kallithea/model/validators.py Thu Jun 18 08:46:07 2015 +0200 +++ b/kallithea/model/validators.py Thu Jun 18 14:54:35 2015 +1200 @@ -458,7 +458,7 @@ elif repo_type == 'git': from kallithea.lib.vcs.backends.git.repository import GitRepository - if url.startswith('http'): + if url.startswith('http') or url.startswith('git'): # initially check if it's at least the proper URL # or does it pass basic auth GitRepository._check_url(url)