Skip to content

Commit f1f2a0e

Browse files
committed
Fix e2e merge-command assertion broken by the ff-only step
Since #40 the conflict comment's fast-forward step reads `git merge --ff-only origin/<branch>`, which assert_conflict_comment_merges picks up with its `^git merge` grep, so the extracted commands never match the expected conflict merges. Skip the --ff-only line when extracting. Also trim the new comments in the fan-out push/retarget/delete sequence. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JHvKryT4QUpHYdNq9YEQxX
1 parent bc5f5a9 commit f1f2a0e

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

tests/test_e2e.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ assert_conflict_comment_merges() {
291291
expected+="git merge $conflict"$'\n'
292292
done
293293
expected=${expected%$'\n'}
294-
actual=$(echo "$comment" | grep -E '^git merge' | sed 's/ *#.*//' || true)
294+
actual=$(echo "$comment" | grep -E '^git merge' | grep -v -- '--ff-only' | sed 's/ *#.*//' || true)
295295

296296
if [[ "$actual" == "$expected" ]]; then
297297
echo >&2 "✅ Verification Passed: conflict comment lists expected merge command(s)."

update-pr-stack.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,9 @@ main() {
311311
fi
312312
done
313313

314-
# Push the updated heads before retargeting, for the same reasons as the
315-
# conflict-resume path: the head already contains TARGET_BRANCH when the
316-
# base flips to it, keeping the PR mergeable (GitHub suppresses CI on a PR
317-
# that conflicts with its base), and a failed push leaves the PR untouched
318-
# on its old base instead of retargeted onto a stale head with nothing to
319-
# re-trigger this action.
314+
# Push the heads before retargeting: a failed push then leaves each PR
315+
# intact on its old base, and the head already contains TARGET_BRANCH when
316+
# the base flips to it.
320317
if [[ "${#UPDATED_TARGETS[@]}" -gt 0 ]]; then
321318
log_cmd git push origin "${UPDATED_TARGETS[@]}"
322319
fi
@@ -325,9 +322,8 @@ main() {
325322
log_cmd gh pr edit "$BRANCH" --base "$TARGET_BRANCH"
326323
done
327324

328-
# Delete the merged branch last: deleting a PR's base branch closes the PR,
329-
# so every child must be retargeted off it first. Keep it while conflicted
330-
# PRs remain so it can be referenced during manual resolution.
325+
# Deleting a PR's base branch closes the PR, so this must come after the
326+
# retargets. Keep the branch for reference while conflicted PRs remain.
331327
if [[ "${#CONFLICTED_TARGETS[@]}" -eq 0 ]]; then
332328
log_cmd git push origin ":$MERGED_BRANCH"
333329
else

0 commit comments

Comments
 (0)