Skip to content

Support for local urls #11

Description

@virresh

git allows local urls in it's path
Currently the parser will put some un-helpful values in the parsed object's tuples if this is the case

Possibly there can be some kind of check for an absolute path, so that in case a user passes a local repository, they get an empty return value

Reproducing code:

$ git clone https://github.com/retr0h/git-url-parse
$ cd git-url-parse
$ pip install -e .
$ python3
>>> import giturlparse
>>> p = giturlparse.parse("/path/to/local/repository/directory/")
>>> print(p)

What we get is :

>>> print(p)
Parsed(pathname='to/local', protocols=[], protocol='ssh', href='/path/to/local/repository/directory/', resource='path', user=None, port=None, name='local', owner='to')

Probably this can be improved, since the protocol='ssh' is highly misleading, and the name, local and resource can also be put to None, along with pathname and href being the same (or preferably href None)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions