Skip to content

Commit fe8ac20

Browse files
author
Arvid Paeglit
committed
updated GIT_URI_OBJ regular express to properly parse commit hashes
1 parent adfb4a3 commit fe8ac20

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

deepcode/git_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import re
22

3-
GIT_URI_OBJ = re.compile('((git@|https://)(?P<platform>[\w\.@]+)(/|:))(?P<owner>[\w,\-,\_]+)/(?P<repo>[\w,\-,\_]+)(.git){0,1}((/){0,1})((@(?P<oid>[0-9]+)){0,1})', re.IGNORECASE)
3+
GIT_URI_OBJ = re.compile('((git@|https://)(?P<platform>[\w\.@]+)(/|:))(?P<owner>[\w,\-,\_]+)/(?P<repo>[\w,\-,\_]+)(.git){0,1}((/){0,1})((@(?P<oid>[0-9a-z]+)){0,1})', re.IGNORECASE)
44

55
def parse_git_uri(uri):
66
"""
77
Parses git uri into dictionary. Both SSH and HTTPS versions are supported
88
SSH version git@github.com:DeepCodeAI/cli.git@1234
99
HTTPS version https://github.com/DeepCodeAI/cli.git@1234
10-
10+
1111
In both cases the result should be: \{ platform: gh, owner: DeepCodeAI, repo: cli, oid: 1234 \}
1212
"""
1313
match = GIT_URI_OBJ.match(uri)

0 commit comments

Comments
 (0)