Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
remote-helper: Handle namespace at process-level
✗ CI failure Lorenz Leutgeb committed 2 months ago
commit b101e4a9b8157f8efe04f6c1cea3c3fd21d2a676
parent 700b0efe1bf935edf88a05d60e7c43b7e1a9d224
1 failed (1 total) View logs
1 file changed +8 -5
modified crates/radicle-remote-helper/src/push.rs
@@ -980,10 +980,16 @@ fn push_ref(
    let path = dunce::canonicalize(stored.path())?.display().to_string();
    // Nb. The *force* indicator (`+`) is processed by Git tooling before we even reach this code.
    // This happens during the `list for-push` phase.
-
    let refspec = git::fmt::refspec::Refspec { src, dst, force };
+
    let refspec = git::fmt::refspec::Refspec {
+
        src,
+
        dst: dst.strip_namespace(),
+
        force,
+
    };

    let mut cmd = std::process::Command::new("git");

+
    cmd.env("GIT_NAMESPACE", dst.namespace().as_str());
+

    let mut args = vec![
        "-c".to_string(),
        "gpg.format=ssh".to_string(),
@@ -1025,10 +1031,7 @@ fn push_ref(
    args.push("--signed=true".to_string());

    for expected in expected_refs {
-
        args.push(format!(
-
            "--force-with-lease=refs/namespaces/{}/{expected}",
-
            dst.namespace()
-
        ));
+
        args.push(format!("--force-with-lease={expected}"));
    }

    cmd.args(args);