Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: code clean up
✗ CI failure Fintan Halpenny committed 7 months ago
commit eff8cbbef6fe9a76f17bf81f6bee29e130c12f74
parent cc76705f3be8e57fc4685f0db12944eeef5d6d74
1 failed (1 total) View logs
2 files changed +5 -6
modified crates/radicle-fetch/src/git/repository.rs
@@ -1,6 +1,7 @@
pub mod error;

use either::Either;
+
use radicle::git::raw::ErrorExt;
use radicle::git::{self, Namespaced, Oid, Qualified};
use radicle::storage::git::Repository;

@@ -53,9 +54,7 @@ fn find_and_peel(repo: &Repository, oid: Oid) -> Result<Oid, error::Ancestry> {
            .map_err(|err| error::Ancestry::Peel { oid, err })?
            .id()
            .into()),
-
        Err(e) if e.code() == git::raw::ErrorCode::NotFound => {
-
            Err(error::Ancestry::Missing { oid })
-
        }
+
        Err(e) if e.is_not_found() => Err(error::Ancestry::Missing { oid }),
        Err(err) => Err(error::Ancestry::Object { oid, err }),
    }
}
modified crates/radicle/src/storage.rs
@@ -134,9 +134,9 @@ pub enum RepositoryError {
impl RepositoryError {
    pub fn is_not_found(&self) -> bool {
        match self {
-
            Self::Storage(e) if e.is_not_found() => true,
-
            Self::GitExt(git_ext::Error::NotFound(_)) => true,
-
            Self::Git(e) if e.is_not_found() => true,
+
            Self::Storage(e) => e.is_not_found(),
+
            Self::GitExt(e) => e.is_not_found(),
+
            Self::Git(e) => e.is_not_found(),
            _ => false,
        }
    }