summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Jimenez <pj@place.org>2014-07-23 11:57:20 -0400
committerLeandro Lucarella <leandro.lucarella@sociomantic.com>2014-10-23 16:48:54 +0200
commitdac2d775de52c06730eb35203eb465b66a121e89 (patch)
tree167697e7156e3b10b6b2045cefa8c3f9174c478c
parent778945b1e4b482487346e7520f508a77f9b9fe05 (diff)
Accept an http URL as a repository location
Fix #95
-rwxr-xr-xgit-hub6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-hub b/git-hub
index c30e8d1..f6dd08f 100755
--- a/git-hub
+++ b/git-hub
@@ -744,9 +744,11 @@ class CloneCmd (object):
@classmethod
def run(cls, parser, args):
- upstream = args.repository
+ from urlparse import urlsplit
+ upstream = urlsplit(args.repository).path
+ if upstream.endswith('.git'): upstream = upstream[:-4]
if '/' in upstream:
- (owner, proj) = upstream.split('/', 1)
+ (owner, proj) = upstream.split('/')[-2:]
for repo in req.get('/user/repos'):
if repo['name'] == proj and repo['fork']:
break