Skip to content

gix_url::Url %-encodes username in scp-like syntax #2056

Open
@yuja

Description

@yuja

Current behavior 😯

This code generates the following output:

fn main() {
    let url = gix_url::parse("[email protected]:org/repo.git".as_ref()).unwrap();
    dbg!(&url);
    println!("{}", url.to_bstring());
}
[src/main.rs:3:5] &url = Url {
    scheme: Ssh,
    user: Some(
        "_git",
    ),
    password: None,
    host: Some(
        "source.example.tld",
    ),
    serialize_alternative_form: true,
    port: None,
    path: "org/repo.git",
}
%[email protected]:org/repo.git

Expected behavior 🤔

I'm not pretty sure, but Git appears not to decode %5Fgit back to _git.

This problem was originally reported as jj-vcs/jj#6810.

Git behavior

No response

Steps to reproduce 🕹

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedan issue is accepted as shortcoming to be fixedhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions