Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
radicle/storage: Improve `Validation` error
Lorenz Leutgeb committed 1 month ago
commit 0e45347b92ba6c78eff9dd66ea11e15c220a6148
parent ba9c09f
2 files changed +5 -2
modified crates/radicle-fetch/src/state.rs
@@ -742,6 +742,7 @@ where
            if let Some(signed_oid) = signed.remove(&refname) {
                if oid != signed_oid {
                    validations.push(Validation::MismatchedRef {
+
                        remote: remote.id(),
                        refname,
                        expected: signed_oid,
                        actual: oid,
modified crates/radicle/src/storage/git.rs
@@ -377,11 +377,12 @@ impl DerefMut for Validations {
pub enum Validation {
    #[error("found unsigned ref `{0}`")]
    UnsignedRef(RefString),
-
    #[error("{refname}: expected {expected}, but found {actual}")]
+
    #[error("expected `refs/namespaces/{remote}/{refname}` at {expected} but found {actual}")]
    MismatchedRef {
+
        remote: RemoteId,
+
        refname: RefString,
        expected: Oid,
        actual: Oid,
-
        refname: RefString,
    },
    #[error("missing `refs/namespaces/{remote}/{refname}`")]
    MissingRef {
@@ -648,6 +649,7 @@ impl ValidateRepository for Repository {
            if let Some(signed_oid) = signed.remove(&refname) {
                if oid != signed_oid {
                    failures.push(Validation::MismatchedRef {
+
                        remote: remote.id(),
                        refname,
                        expected: signed_oid,
                        actual: oid,