feat(FN-4606): complete Step 4 — enhance worktree root lookup
Ref: Runfusion/Fusion#321 Fusion-Task-Id: FN-4606 Fusion-Task-Lineage: 94b23f37-944e-4bcd-bfa1-67d0a8c0a267
This commit is contained in:
@@ -88,6 +88,20 @@ describe("getProjectRootFromWorktree", () => {
|
||||
expect(getProjectRootFromWorktree("C:\\repo\\.worktrees\\fn-001")).toBe("C:\\repo");
|
||||
expect(getProjectRootFromWorktree("C:\\repo\\.worktrees\\fn-001\\src\\file.ts")).toBe("C:\\repo");
|
||||
});
|
||||
|
||||
it("supports configured candidate worktrees dir paths", () => {
|
||||
expect(
|
||||
getProjectRootFromWorktree("/tmp/.fn-worktrees/repo/fn-001/src", {
|
||||
worktreesDirCandidates: ["/tmp/.fn-worktrees/repo"],
|
||||
}),
|
||||
).toBe("/tmp/.fn-worktrees");
|
||||
|
||||
expect(
|
||||
getProjectRootFromWorktree("/tmp/repo.worktrees/fn-001", {
|
||||
worktreesDirCandidates: ["/tmp/repo.worktrees"],
|
||||
}),
|
||||
).toBe("/tmp");
|
||||
});
|
||||
});
|
||||
|
||||
// Initialize mocks before first test
|
||||
|
||||
Reference in New Issue
Block a user