fix(agentctl): resume integrate prepare from clean expected tip

After abort, allow a clean worktree parked on expected-dev to continue merge instead of BASE_CHANGED.
This commit is contained in:
weichen
2026-09-24 14:16:48 +00:00
parent f5cdae1a41
commit 77c602c8f4
+5 -3
View File
@@ -167,9 +167,11 @@ def integrate_prepare(repo: ac.Repo, args) -> dict:
if porcelain:
ac.deny('INVALID_REQUEST', 'Existing integrate worktree is dirty',
path=str(integ_path))
# Different base: refuse rather than reset.
ac.deny('BASE_CHANGED', 'Integrate worktree exists for a different base; remove it first',
path=str(integ_path), head=head)
if head != expected:
# Different base: refuse rather than reset.
ac.deny('BASE_CHANGED', 'Integrate worktree exists for a different base; remove it first',
path=str(integ_path), head=head)
# Clean checkout parked on expected-dev (e.g. after abort): continue to merge.
else:
integ_path.parent.mkdir(exist_ok=True)
ac.git(repo.main, 'worktree', 'add', '-b', branch, str(integ_path), expected)