Skip to content

Commit e531a86

Browse files
committed
Corrected bug where name contains a '.'
Fixes: #33
1 parent ba63452 commit e531a86

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

giturlparse/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
r'[:/]*'
4343
r'(?P<port>[\d]+){0,1}'
4444
r'(?P<pathname>\/((?P<owner>[\w\-]+)\/)?'
45-
r'((?P<name>[\w\-]+)(\.git)?)?)$'),
45+
r'((?P<name>[\w\-\.]+?)(\.git)?)?)$'),
4646
re.compile(r'(git\+)?'
4747
r'((?P<protocol>\w+)://)'
4848
r'((?P<user>\w+)@)?'

test/conftest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,30 @@ def first_match_urls():
236236
'name': 'sphinx',
237237
'owner': 'sphinx-doc',
238238
},
239+
# https://github.com/retr0h/git-url-parse/issues/33
240+
'https://github.com/tterranigma/Stouts.openvpn': {
241+
'pathname': '/tterranigma/Stouts.openvpn',
242+
'protocols': ['https'],
243+
'protocol': 'https',
244+
'href': 'https://github.com/tterranigma/Stouts.openvpn',
245+
'resource': 'github.com',
246+
'user': None,
247+
'port': None,
248+
'name': 'Stouts.openvpn',
249+
'owner': 'tterranigma',
250+
},
251+
# https://github.com/retr0h/git-url-parse/issues/33
252+
'https://github.com/tterranigma/Stouts.openvpn.git': {
253+
'pathname': '/tterranigma/Stouts.openvpn.git',
254+
'protocols': ['https'],
255+
'protocol': 'https',
256+
'href': 'https://github.com/tterranigma/Stouts.openvpn.git',
257+
'resource': 'github.com',
258+
'user': None,
259+
'port': None,
260+
'name': 'Stouts.openvpn',
261+
'owner': 'tterranigma',
262+
},
239263
}
240264

241265

0 commit comments

Comments
 (0)