diff --git a/radicle/src/storage/git.rs b/radicle/src/storage/git.rs index fc405c84..d9195474 100644 --- a/radicle/src/storage/git.rs +++ b/radicle/src/storage/git.rs @@ -894,7 +894,7 @@ mod tests { }); // Register the `rad://` transport. - transport::register("rad").unwrap(); + transport::register().unwrap(); // Fetch with the `rad://` transport. target .remote_anonymous(&format!("rad://{}", proj)) diff --git a/radicle/src/storage/git/transport.rs b/radicle/src/storage/git/transport.rs index 7d887fbe..8a843abf 100644 --- a/radicle/src/storage/git/transport.rs +++ b/radicle/src/storage/git/transport.rs @@ -160,13 +160,14 @@ impl io::Read for Stream { /// /// Returns an error if called more than once. /// -pub fn register(prefix: &str) -> Result<(), git2::Error> { +pub fn register() -> Result<(), git2::Error> { static REGISTERED: atomic::AtomicBool = atomic::AtomicBool::new(false); // Registration is not thread-safe, so make sure we prevent re-entrancy. if !REGISTERED.swap(true, atomic::Ordering::SeqCst) { unsafe { - git2::transport::register(prefix, move |remote| { + let prefix = git::url::Scheme::Radicle.to_string(); + git2::transport::register(&prefix, move |remote| { git2::transport::Transport::smart(remote, false, self::smart()) }) }