anvilsign in

collin/anvil · 2f35cebb

Drop the ssh:// prefix from clone URLs on the default port

Collin Richards · 2026-08-18 17:28 UTC · 2f35cebbbbd354d178741ac6c375a3f1dd547905 · parent e922ead7 · browse files

modifiedcrates/anvil-core/src/config.rs+4 −5
⋯ 546 unchanged lines
547547
548548 /// The SSH clone URL for `<owner>/<name>`, using the externally advertised
549549 /// host/port/user (which may differ from the internal bind under Docker).
550- /// The port is omitted when it is the SSH default (22).
550+ /// On the SSH default (22), this is the scp-like `user@host:path` form,
551+ /// which needs no `ssh://` scheme or port; a non-default port can only be
552+ /// expressed with the `ssh://` form, so that's used instead.
551553 pub fn ssh_clone_url(&self, owner: &str, name: &str) -> String {
552554 let ssh = &self.ssh;
553555 if ssh.clone_port == 22 {
554- format!(
555- "ssh://{}@{}/{owner}/{name}.git",
556- ssh.clone_user, ssh.clone_host
557- )
556+ format!("{}@{}:{owner}/{name}.git", ssh.clone_user, ssh.clone_host)
558557 } else {
559558 format!(
560559 "ssh://{}@{}:{}/{owner}/{name}.git",
⋯ 125 unchanged lines