Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
A couple of docs and naming improvements
Alexis Sellier committed 3 years ago
commit 5f4fc8236ee08ae279a1e09f033bfb5acddcf607
parent 8b834a7b6e1b18c0ad7a2afba0acb6c20ae43c5f
2 files changed +7 -7
modified radicle/src/storage.rs
@@ -244,8 +244,8 @@ pub trait ReadRepository {

    /// Get the head of this repository.
    ///
-
    /// Returns the value of `HEAD` if it is set, otherwise computes the canonical head
-
    /// using [`ReadRepository::canonical_head`].
+
    /// Returns the reference pointed to by `HEAD` if it is set. Otherwise, computes the canonical
+
    /// head using [`ReadRepository::canonical_head`].
    ///
    /// Returns the [`Oid`] as well as the qualified reference name.
    fn head(&self) -> Result<(Qualified, Oid), ProjectError>;
modified radicle/src/storage/git.rs
@@ -233,7 +233,7 @@ impl Repository {
            })
            .collect::<Result<_, VerifyError>>()?;

-
        for entry in self.public_references()? {
+
        for entry in self.namespaced_references()? {
            let (remote_id, refname, oid) = entry?;
            let remote = remotes
                .get_mut(&remote_id)
@@ -368,8 +368,8 @@ impl Repository {
        Ok(remotes)
    }

-
    /// Return all references that are public, ie. that are replicated, verified and signed.
-
    fn public_references(
+
    /// Return all references that are namespaced, ie. that are signed by a node and verified.
+
    fn namespaced_references(
        &self,
    ) -> Result<impl Iterator<Item = Result<(RemoteId, Qualified, Oid), refs::Error>>, git2::Error>
    {
@@ -877,7 +877,7 @@ mod tests {
    }

    #[test]
-
    fn test_public_references() {
+
    fn test_namespaced_references() {
        let tmp = tempfile::tempdir().unwrap();
        let signer = MockSigner::default();
        let storage = Storage::open(tmp.path().join("storage")).unwrap();
@@ -886,7 +886,7 @@ mod tests {
        let proj = storage.repository(id).unwrap();

        let mut refs = proj
-
            .public_references()
+
            .namespaced_references()
            .unwrap()
            .map(|r| r.unwrap())
            .map(|(_, r, _)| r.to_string())