Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Generate a prefix for raw downloads
Merged shawn.webb opened 4 days ago

GitHub and GitLab will prefix archive payloads with the name of the repo and the refspec. This patch naively applies a prefix in similar fashion.

The refspec might contain filesystem path separators, like a forward slash (/). GitHub and GitLab replace that with a hyphen (-). This patch applies that same replacement.

Signed-off-by: Shawn Webb shawn.webb@hardenedbsd.org

1 file changed +2 -0 d0a012dc ad8b0699
modified radicle-httpd/src/raw.rs
@@ -119,7 +119,9 @@ async fn archive_by_refname(
    let output = Command::new("git")
        .arg("archive")
        .arg("--format=tar.gz")
+
        .arg(format!("--prefix={}-{}/", repo_name, refname.replace("/", "-")))
        .arg(oid.to_string())
+
        .arg("--")
        .current_dir(repo.path())
        .output()?;