Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
protocol: Decode `radicle_oid::Oid` without `git2`
Lorenz Leutgeb committed 2 days ago
commit 8dba3ca9de63383531caef6a8ce230ec799ef334
parent 3d1b37f
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)?))
    }
}