Skip to content

Commit acf1bbe

Browse files
committed
fix: strip trailing slash from parentCwd before slicing in resolveWorktreeAutoRunPath
1 parent 5e287d2 commit acf1bbe

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/renderer/utils/worktreeSession.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function resolveWorktreeAutoRunPath(
7474
if (!isAbsolute) return parentAutoRunPath;
7575

7676
if (isPathUnderRoot(parentAutoRunPath, parentCwd)) {
77-
const normalizedParentCwd = normSep(parentCwd);
77+
// Strip trailing slash for consistent slicing
78+
const normalizedParentCwd = normSep(parentCwd).replace(/\/$/, '');
7879
const normalized = normSep(parentAutoRunPath);
7980
const relativePart = normalized.slice(normalizedParentCwd.length);
8081
const result = normSep(worktreeCwd) + relativePart;

0 commit comments

Comments
 (0)