Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle: Allow all references to be included in sigrefs
✗ CI failure Defelo committed 3 months ago
commit a4e66d141e02a3b1e58b21b4c67cab61a971da5a
parent 67dee65549b9bbd8fbd3bfec47c5f9b78c177d26
1 failed (1 total) View logs
2 files changed +22 -13
modified CHANGELOG.md
@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## New Features

+
- The set of references returned by `references_of` were restricted to `heads`,
+
  `tags`, `notes`, `rad`, and `cobs`. The restriction is lifted, and the only
+
  references filtered out are `refs/tmp/heads` – used by `radicle-remote-helper`
+
  to create temporary patches.
+

## Fixed Bugs

## Deprecations
modified crates/radicle/src/storage/git.rs
@@ -739,6 +739,17 @@ impl ReadRepository for Repository {
            .graph_descendant_of(head.into(), ancestor.into())
    }

+
    /// The published references of the given `remote`.
+
    ///
+
    /// Note that this includes all references, including `refs/rad/sigrefs`.
+
    /// This reference must be removed before signing the payload.
+
    ///
+
    /// # Skipped References
+
    ///
+
    /// References created by [`staging::patch`], i.e. references that begin
+
    /// with `refs/tmp/heads`, are skipped.
+
    ///
+
    /// [`staging::patch`]: crate::git::refs::storage::staging::patch
    fn references_of(&self, remote: &RemoteId) -> Result<Refs, Error> {
        let entries = self
            .backend
@@ -750,20 +761,13 @@ impl ReadRepository for Repository {
            let name = e.name().ok_or(Error::InvalidRef)?;
            let (_, refname) = git::parse_ref::<RemoteId>(name)?;
            let oid = e.resolve()?.target().ok_or(Error::InvalidRef)?;
-
            let (_, category, _, _) = refname.non_empty_components();
+
            let (_, category, subcategory, _) = refname.non_empty_components();

-
            use git::fmt::{component, name};
-

-
            if [
-
                name::HEADS,
-
                name::TAGS,
-
                name::NOTES,
-
                &component!("rad"),
-
                &component!("cobs"),
-
            ]
-
            .contains(&category.as_ref())
-
            {
-
                refs.insert(refname.into(), oid.into());
+
            match (category.as_str(), subcategory.as_str()) {
+
                ("tmp", "heads") => continue,
+
                _ => {
+
                    refs.insert(refname.into(), oid.into());
+
                }
            }
        }
        Ok(refs.into())