Harden already-merged detection to exact string match
Some checks are pending
CI / lint-and-test (push) Waiting to run

Ganymede review nit: substring match on "already" could false-positive
on future return strings. Pin to the two known values from cherry_pick().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
m3taversal 2026-04-15 17:06:12 +01:00
parent ad7ee0831e
commit 1755580b95

View file

@ -1464,7 +1464,7 @@ async def _merge_domain_queue(conn, domain: str) -> tuple[int, int]:
# Cherry-pick returns "already merged" when all commits are empty.
# The branch ref still points at old commits (not a descendant of main),
# so pushing branch_sha:main would fail as non-fast-forward.
if "already" in pick_msg.lower():
if pick_msg in ("already merged (all commits empty)", "already up to date"):
conn.execute(
"UPDATE prs SET status = 'merged', merged_at = datetime('now'), last_error = NULL WHERE number = ?",
(pr_num,),