Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
remote-helper: Don't update patch if up-to-date
Alexis Sellier committed 3 years ago
commit c267ff71f1e81077d4f59b47ccc5050a101348ee
parent a1674600e94a6b6bb9fb31a0a3e523b5d2a9f743
1 file changed +5 -0
modified radicle-remote-helper/src/push.rs
@@ -330,6 +330,11 @@ fn patch_update<G: Signer>(
    let Ok(mut patch) = patches.get_mut(&patch_id) else {
        return Err(Error::NotFound(patch_id));
    };
+

+
    // Don't update patch if it already has a revision matching this commit.
+
    if patch.revisions().any(|(_, r)| *r.head() == commit.id()) {
+
        return Ok(());
+
    }
    let message = cli::patch::get_update_message(cli::patch::Message::Edit)?;
    let (_, target) = stored.canonical_head()?;
    let base = stored.backend.merge_base(*target, commit.id())?;