giturlparse icon indicating copy to clipboard operation
giturlparse copied to clipboard

Url type conversion from full http url with branch

Open non7top opened this issue 1 year ago • 0 comments

Description

When parsing the full github url which can point to branch and the using urls the tree/branch name should not be part of ssh and git urls.

Steps to reproduce

>>> from giturlparse import parse
>>> p=parse("https://example.com/user/repo/tree/branch")
>>> p.urls
{'https': 'https://example.com/user/repo/tree/branch.git', 'ssh': '[email protected]:user/repo/tree/branch.git', 'git': 'git://example.com/user/repo/tree/branch.git'}

Versions

Expected behaviour

[email protected]:user/repo.git git://example.com/user/repo.git

I do not know whether it is possible to specify branch in this notation at all.

Actual behaviour

[email protected]:user/repo/tree/branch.git is invalid git://example.com/user/repo/tree/branch.git is invalid

Additional information

I do realize this is not exactly the right "git url". The input type should probably be github_web or something.

non7top avatar Oct 01 '24 19:10 non7top