From e4834dbba9c73f1695952a000692a6b8b13b87ee Mon Sep 17 00:00:00 2001 From: Caleb Owens Date: Wed, 4 Sep 2024 13:33:57 +0200 Subject: [PATCH] Fancy fast forward --- crates/gitbutler-repo/src/rebase.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/gitbutler-repo/src/rebase.rs b/crates/gitbutler-repo/src/rebase.rs index 60e2b44dee..d21c7372a3 100644 --- a/crates/gitbutler-repo/src/rebase.rs +++ b/crates/gitbutler-repo/src/rebase.rs @@ -61,6 +61,10 @@ pub fn cherry_rebase_group( |head, to_rebase| { let head = head?; + if to_rebase.parent_ids().len() == 1 && head.id() == to_rebase.parent_id(0)? { + return Ok(to_rebase); + }; + let cherrypick_index = repository .cherry_pick_gitbutler(&head, &to_rebase, None) .context("failed to cherry pick")?;