remote-helper: Don't update patch if up-to-date
If the patch has a revision with a matching commit, there's no need to update it again.
This commit is contained in:
parent
a1674600e9
commit
c267ff71f1
|
|
@ -330,6 +330,11 @@ fn patch_update<G: Signer>(
|
||||||
let Ok(mut patch) = patches.get_mut(&patch_id) else {
|
let Ok(mut patch) = patches.get_mut(&patch_id) else {
|
||||||
return Err(Error::NotFound(patch_id));
|
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 message = cli::patch::get_update_message(cli::patch::Message::Edit)?;
|
||||||
let (_, target) = stored.canonical_head()?;
|
let (_, target) = stored.canonical_head()?;
|
||||||
let base = stored.backend.merge_base(*target, commit.id())?;
|
let base = stored.backend.merge_base(*target, commit.id())?;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue