Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
lint: Fixes
Adrian Duke committed 7 days ago
commit 75d35fa458b3166ccf50e1f945574a8e8c852ac9
parent 9febeedaa48bcce77d679086c1fe9275e8360f2b
2 files changed +27 -27
modified crates/radicle-remote-helper/src/push.rs
@@ -836,29 +836,29 @@ where

        // If we're pushing to a valid canonical branch, we want to see if any patches got
        // merged or reverted, and if so, update the patch COB.
-
        if let Some((_, rule)) = rules.matches(&stripped_dst).next() {
-
            if rule.allowed().contains(&me) {
-
                let old = old.peel_to_commit()?.id();
-
                let destination = Some(stripped_dst.to_ref_string());
-

-
                patch_revert_all(
-
                    old.into(),
-
                    head,
-
                    destination.clone(),
-
                    &stored.backend,
-
                    &mut patches,
-
                    &identity,
-
                )?;
-
                patch_merge_all(
-
                    old.into(),
-
                    head,
-
                    destination,
-
                    working,
-
                    &mut patches,
-
                    signer,
-
                    &identity,
-
                )?;
-
            }
+
        if let Some((_, rule)) = rules.matches(&stripped_dst).next()
+
            && rule.allowed().contains(&me)
+
        {
+
            let old = old.peel_to_commit()?.id();
+
            let destination = Some(stripped_dst.to_ref_string());
+

+
            patch_revert_all(
+
                old.into(),
+
                head,
+
                destination.clone(),
+
                &stored.backend,
+
                &mut patches,
+
                &identity,
+
            )?;
+
            patch_merge_all(
+
                old.into(),
+
                head,
+
                destination,
+
                working,
+
                &mut patches,
+
                signer,
+
                &identity,
+
            )?;
        }
    }
    Ok(Some(ExplorerResource::Tree { oid: head }))
modified crates/radicle/src/cob/patch.rs
@@ -750,10 +750,10 @@ impl Patch {
                    return Ok(Authorization::Deny);
                }

-
                if let Ok(crefs) = doc.canonical_refs() {
-
                    if let Some((_, rule)) = crefs.rules().matches(&dest).next() {
-
                        return Ok(Authorization::from(rule.allowed().contains(&actor.into())));
-
                    }
+
                if let Ok(crefs) = doc.canonical_refs()
+
                    && let Some((_, rule)) = crefs.rules().matches(&dest).next()
+
                {
+
                    return Ok(Authorization::from(rule.allowed().contains(&actor.into())));
                }

                Authorization::Deny