gix_ref/
peel.rs

1///
2pub mod to_id {
3    use gix_object::bstr::BString;
4
5    /// The error returned by [`crate::file::ReferenceExt::peel_to_id_in_place()`].
6    #[derive(Debug, thiserror::Error)]
7    #[allow(missing_docs)]
8    pub enum Error {
9        #[error(transparent)]
10        FollowToObject(#[from] super::to_object::Error),
11        #[error("An error occurred when trying to resolve an object a reference points to")]
12        Find(#[from] gix_object::find::Error),
13        #[error("Object {oid} as referred to by {name:?} could not be found")]
14        NotFound { oid: gix_hash::ObjectId, name: BString },
15    }
16}
17
18///
19pub mod to_object {
20    use std::path::PathBuf;
21
22    use crate::file;
23
24    /// The error returned by [`file::ReferenceExt::follow_to_object_in_place_packed()`].
25    #[derive(Debug, thiserror::Error)]
26    #[allow(missing_docs)]
27    pub enum Error {
28        #[error("Could not follow a single level of a symbolic reference")]
29        Follow(#[from] file::find::existing::Error),
30        #[error("Aborting due to reference cycle with first seen path being {start_absolute:?}")]
31        Cycle { start_absolute: PathBuf },
32        #[error("Refusing to follow more than {max_depth} levels of indirection")]
33        DepthLimitExceeded { max_depth: usize },
34    }
35}