Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
Only support `rad://` in the custom proto
Alexis Sellier committed 3 years ago
commit f85a0426d7c41a312e005a9ce4024d7760613c8e
parent 1da38708fc6f07ae9ae2f773b03b35c458afe371
2 files changed +4 -3
modified 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))
modified 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())
            })
        }