Skip to content

Cannot parse ssh://git@bitbucket:7999/MY_ORG/my_repo.git since v12 #153

@niryarden

Description

@niryarden

The ssh git url from my BitBucket (On-Prem) server isn't parsed properly by the module anymore, since version 12.
I'm not sure what specifically makes it different from other URLs, but it used to work until I tried to upgrade the module, and the URL is copied and pasted from bitbucket, didn't add or remove anything from it.

As you can see, many of the returned attributes are broken:
port, resource, sort, owner, organization, full_name

The URL:

ssh://git@bitbucket:7999/MY_ORG/my_repo.git

git-url-parse version 11.6.0 response:

{
    "protocols": [
        "ssh"
    ],
    "protocol": "ssh",
    "port": 7999,
    "resource": "bitbucket",
    "user": "git",
    "pathname": "/MY_ORG/my_repo.git",
    "hash": "",
    "search": "",
    "href": "ssh://git@bitbucket:7999/MY_ORG/my_repo.git",
    "query": {},
    "token": "",
    "source": "bitbucket",
    "git_suffix": true,
    "name": "my_repo",
    "owner": "MY_ORG",
    "ref": "",
    "filepathtype": "",
    "filepath": "",
    "organization": "MY_ORG",
    "full_name": "MY_ORG/my_repo"
}

git-url-parse version 13.1.0 response:

{
    "protocols": [
        "ssh"
    ],
    "protocol": "ssh",
    "port": "",
    "resource": "",
    "host": "",
    "user": "",
    "password": "",
    "pathname": "//git@bitbucket:7999/MY_ORG/my_repo.git",
    "hash": "",
    "search": "",
    "href": "ssh://git@bitbucket:7999/MY_ORG/my_repo.git",
    "query": {},
    "parse_failed": false,
    "token": "",
    "source": "",
    "git_suffix": true,
    "name": "my_repo",
    "owner": "/git@bitbucket:7999/MY_ORG",
    "ref": "",
    "filepathtype": "",
    "filepath": "",
    "organization": "/git@bitbucket:7999/MY_ORG",
    "full_name": "/git@bitbucket:7999/MY_ORG/my_repo"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions