Skip to content

Commit a9a4d4d

Browse files
committed
Adapt to changes in gix-url
1 parent 402bcc7 commit a9a4d4d

File tree

1 file changed

+6
-1
lines changed
  • gix-credentials/src/protocol/context

1 file changed

+6
-1
lines changed

gix-credentials/src/protocol/context/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ mod mutate {
101101
self.username = url.user().map(ToOwned::to_owned);
102102
self.password = url.password().map(ToOwned::to_owned);
103103
self.host = url.host().map(ToOwned::to_owned).map(|mut host| {
104-
if let Some(port) = url.port {
104+
let port = url.port.filter(|port| {
105+
url.scheme
106+
.default_port()
107+
.is_none_or(|default_port| *port != default_port)
108+
});
109+
if let Some(port) = port {
105110
use std::fmt::Write;
106111
write!(host, ":{port}").expect("infallible");
107112
}

0 commit comments

Comments
 (0)