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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user