diff --git a/lib/merge.py b/lib/merge.py index 1d54bf2..0e4ccef 100644 --- a/lib/merge.py +++ b/lib/merge.py @@ -308,7 +308,14 @@ async def _cherry_pick_onto_main(branch: str) -> tuple[bool, str]: rc, merge_base = await _git("merge-base", "origin/main", f"origin/{branch}") rc2, main_sha = await _git("rev-parse", "origin/main") if rc == 0 and rc2 == 0 and merge_base.strip() == main_sha.strip(): - return True, "already up to date" + # Branch is descendant of main — but fork workflows (merge main into branch) + # create this state while still having new content. Check for actual diff. + rc_diff, diff_out = await _git( + "diff", "--stat", f"origin/main..origin/{branch}", timeout=10, + ) + if rc_diff != 0 or not diff_out.strip(): + return True, "already up to date" + logger.info("Branch %s is descendant of main but has new content — proceeding", branch) # Get extraction commits (oldest first), skip merge commits from fork workflows rc, commits_out = await _git(