Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node/test: `NodeHandle::commit_to` should namespace
Fintan Halpenny committed 3 days ago
commit 8fff73e6a7966705cf9d0b35f5e6a29732ef9bf6
parent 0bc8f51e7dcb914c72dd266e8bf2222a803bf648
1 file changed +8 -3
modified crates/radicle-node/src/test/node.rs
@@ -365,8 +365,8 @@ impl<G: Signer<Signature> + cyphernet::Ecdh> NodeHandle<G> {
        *issues.create(title, desc, &[], &[], []).unwrap().id()
    }

-
    /// Perform a commit to `refname` by generating a blob of random data to a
-
    /// random path in a new tree.
+
    /// Perform a commit to `refname`, within the node's namespace, by
+
    /// generating a blob of random data to a random path in a new tree.
    ///
    /// If the reference does not exist, a new one will be created with the new
    /// commit as its target.
@@ -378,7 +378,12 @@ impl<G: Signer<Signature> + cyphernet::Ecdh> NodeHandle<G> {
    pub fn commit_to(&self, rid: RepoId, refname: impl AsRef<git::fmt::RefStr>) {
        use radicle::test::arbitrary;

-
        let refname = refname.as_ref();
+
        let refname = match git::fmt::Qualified::from_refstr(refname.as_ref()) {
+
            None => git::fmt::lit::refs_heads(refname).into(),
+
            Some(refname) => refname,
+
        };
+
        let refname = refname.with_namespace(self.id.to_component());
+

        let repo = self.storage.repository(rid).unwrap();
        let raw = &repo.backend;