mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Don't redact username git
for SSH (#13799)
Fixes #13795 specifically by not redacting the username convention `git` for SSH URLs, though we should never write stars in `uv export` generally (#13791).
This commit is contained in:
parent
99a4b78af2
commit
eb9ad6c8c0
1 changed files with 13 additions and 1 deletions
|
@ -91,7 +91,10 @@ impl DisplaySafeUrl {
|
|||
pub fn remove_credentials(&mut self) {
|
||||
// For URLs that use the `git` convention (i.e., `ssh://git@github.com/...`), avoid dropping the
|
||||
// username.
|
||||
if self.0.scheme() == "ssh" && self.0.username() == "git" && self.0.password().is_none() {
|
||||
if matches!(self.0.scheme(), "git+ssh" | "ssh")
|
||||
&& self.0.username() == "git"
|
||||
&& self.0.password().is_none()
|
||||
{
|
||||
return;
|
||||
}
|
||||
let _ = self.0.set_username("");
|
||||
|
@ -180,6 +183,15 @@ fn display_with_redacted_credentials(
|
|||
return write!(f, "{url}");
|
||||
}
|
||||
|
||||
// For URLs that use the `git` convention (i.e., `ssh://git@github.com/...`), avoid dropping the
|
||||
// username.
|
||||
if matches!(url.scheme(), "git+ssh" | "ssh")
|
||||
&& url.username() == "git"
|
||||
&& url.password().is_none()
|
||||
{
|
||||
return write!(f, "{url}");
|
||||
}
|
||||
|
||||
write!(f, "{}://", url.scheme())?;
|
||||
|
||||
if url.username() != "" && url.password().is_some() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue