Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: Skip zero oids
Alexis Sellier committed 3 years ago
commit 071465388c83b21778940c861a99c8c3f50f5261
parent 5b86131257d3b5104bf55c45c235df7b4cae2daa
1 file changed +6 -1
modified node/src/storage/refs.rs
@@ -104,6 +104,9 @@ impl Refs {
            let name = git::RefString::try_from(name)?;
            let oid = Oid::from_str(oid)?;

+
            if oid.is_zero() {
+
                continue;
+
            }
            refs.insert(name, oid);
        }
        Ok(Self(refs))
@@ -111,7 +114,9 @@ impl Refs {

    pub fn canonical(&self) -> Vec<u8> {
        let mut buf = String::new();
-
        let refs = self.iter().filter(|(name, _)| *name != &*SIGNATURE_REF);
+
        let refs = self
+
            .iter()
+
            .filter(|(name, oid)| *name != &*SIGNATURE_REF && !oid.is_zero());

        for (name, oid) in refs {
            buf.push_str(&oid.to_string());