Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
protocol: Decode `radicle_oid::Oid` without `git2`
Lorenz Leutgeb committed 14 days ago
commit 735e45b7e12d653ad1a9d237024e006f72d60b2f
parent 54164f84033d7ea74c58d758fc02c5eba7309303
1 file changed +1 -6
modified crates/radicle-protocol/src/wire.rs
@@ -21,7 +21,6 @@ use cypheraddr::tor;
use radicle::crypto::{PublicKey, Signature};
use radicle::git;
use radicle::git::fmt;
-
use radicle::git::raw;
use radicle::identity::RepoId;
use radicle::node;
use radicle::node::Alias;
@@ -390,11 +389,7 @@ impl Decode for git::Oid {
            return Err(Invalid::Oid { actual: len }.into());
        }

-
        let buf: [u8; git::Oid::SHA1_LEN] = Decode::decode(buf)?;
-
        let oid = raw::Oid::from_bytes(&buf).expect("the buffer is exactly the right size");
-
        let oid = git::Oid::from(oid);
-

-
        Ok(oid)
+
        Ok(git::Oid::Sha1(Decode::decode(buf)?))
    }
}