Skip to content

Commit

Permalink
Merge pull request #32 from retr0h/bug-29
Browse files Browse the repository at this point in the history
Corrected processing of URLs with hyphen
  • Loading branch information
retr0h authored Mar 9, 2019
2 parents 3c3ba25 + ea32b30 commit 3e2bf91
Show file tree
Hide file tree
Showing 3 changed files with 209 additions and 105 deletions.
9 changes: 5 additions & 4 deletions giturlparse/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,24 @@
r'(?P<resource>[a-z0-9_.-]*)'
r'[:/]*'
r'(?P<port>[\d]+){0,1}'
r'(?P<pathname>\/(?P<owner>.+)/(?P<name>.+).git)'),
r'(?P<pathname>\/((?P<owner>[\w\-]+)\/)?'
r'((?P<name>[\w\-]+)(\.git)?)?)$'),
re.compile(r'(git\+)?'
r'((?P<protocol>\w+)://)'
r'((?P<user>\w+)@)?'
r'((?P<resource>[\w\.\-]+))'
r'(:(?P<port>\d+))?'
r'(?P<pathname>(\/(?P<owner>\w+)/)?'
r'(\/?(?P<name>[\w\-]+)(\.git)?)?)'),
r'(\/?(?P<name>[\w\-]+)(\.git)?)?)$'),
re.compile(r'^(?:(?P<user>.+)@)*'
r'(?P<resource>[a-z0-9_.-]*)[:/]*'
r'(?P<port>[\d]+){0,1}'
r'[:](?P<pathname>\/?(?P<owner>.+)/(?P<name>.+).git)'),
r'[:](?P<pathname>\/?(?P<owner>.+)/(?P<name>.+).git)$'),
re.compile(r'((?P<user>\w+)@)?'
r'((?P<resource>[\w\.\-]+))'
r'[\:\/]{1,2}'
r'(?P<pathname>((?P<owner>\w+)/)?'
r'((?P<name>[\w\-]+)(\.git)?)?)'),
r'((?P<name>[\w\-]+)(\.git)?)?)$'),
)


Expand Down
Loading

0 comments on commit 3e2bf91

Please sign in to comment.