Files
heartwood/crates/radicle-fetch/src/git.rs
T
Lorenz Leutgeb 5bc2dc677b repo: Move workspace crates into crates subdirectory
This keeps the top level of the repo cleaner, e.g.
<https://github.com/radicle-dev/heartwood> scrolls less and
<https://app.radicle.xyz/nodes/rosa.radicle.xyz/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5/>
might show more files at the top level.

This way we also don't have to explicitly name all crates in
`Cargo.toml`.
2025-06-09 15:09:21 +02:00

24 lines
609 B
Rust

pub(crate) mod mem;
pub(crate) mod packfile;
pub(crate) mod repository;
pub mod refs;
pub(crate) mod oid {
//! Helper functions for converting to/from [`radicle::git::Oid`] and
//! [`ObjectId`].
use gix_hash::ObjectId;
use radicle::git::Oid;
/// Convert from an [`ObjectId`] to an [`Oid`].
pub fn to_oid(oid: ObjectId) -> Oid {
Oid::try_from(oid.as_bytes()).expect("invalid gix Oid")
}
/// Convert from an [`Oid`] to an [`ObjectId`].
pub fn to_object_id(oid: Oid) -> ObjectId {
ObjectId::from(gix_hash::oid::from_bytes_unchecked(oid.as_ref()))
}
}