FN-5794: run worktree init for fresh merge workspaces

Run merge worktree initialization automatically when a merge workspace is newly created.

- detect when integration worktree creation is fresh and invoke the configured init command
- preserve existing behavior for already-initialized worktrees while improving setup reliability
- add integration tests covering init command execution paths for merge worktree setup

Files changed:
 .changeset/fn-5794-merge-worktree-init.md          |  5 +++
 .../__tests__/merger-integration-worktree.test.ts  | 16 +++++++++
 packages/engine/src/merger.ts                      | 39 +++++++++++++++++++++-
 3 files changed, 59 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5794

Fusion-Task-Lineage: f368099f-a179-466e-b994-2a503167112c
This commit is contained in:
gsxdsm
2026-05-31 17:52:57 -07:00
parent fc4fc9c3cf
commit fa428a487b
3 changed files with 59 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@runfusion/fusion": patch
---
Run the configured `worktreeInitCommand` when the merger has to create a fresh merge worktree during reuse-worktree reacquisition. This bootstraps newly created merge workspaces before merge verification/workflow steps run, while leaving pooled/reused existing worktrees unchanged.