fix(FN-4686): align worktrunk create audit semantics
Fusion-Task-Id: FN-4686 Fusion-Task-Lineage: a1e58bd8-fd94-471a-b164-c396c5512fea
This commit is contained in:
committed by
gsxdsm
parent
5e14a9459a
commit
cc065f7f23
@@ -80,6 +80,9 @@ describe("acquireTaskWorktree backend wiring", () => {
|
||||
expect(
|
||||
audit.git.mock.calls.filter(([event]) => event?.type === "worktree:worktrunk-create"),
|
||||
).toHaveLength(1);
|
||||
expect(audit.git).not.toHaveBeenCalledWith(
|
||||
expect.objectContaining({ type: "worktree:create" }),
|
||||
);
|
||||
});
|
||||
|
||||
it("throws worktrunk_binary_missing with no binaryPath", async () => {
|
||||
|
||||
@@ -239,7 +239,9 @@ export async function acquireTaskWorktree(opts: AcquireTaskWorktreeOptions): Pro
|
||||
worktreePath = created.path;
|
||||
branch = created.branch;
|
||||
await store.updateTask(task.id, { worktree: created.path, branch: created.branch });
|
||||
await audit?.git({ type: "worktree:create", target: created.path, metadata: { branch: created.branch } });
|
||||
if (backend.kind !== "worktrunk") {
|
||||
await audit?.git({ type: "worktree:create", target: created.path, metadata: { branch: created.branch } });
|
||||
}
|
||||
await audit?.git({ type: "branch:create", target: created.branch });
|
||||
if (created.branch !== branchName) {
|
||||
logger?.log(`Branch conflict resolved: using ${created.branch} instead of ${branchName}`);
|
||||
|
||||
Reference in New Issue
Block a user