Skip to content

Commit f330211

Browse files
committed
Harden worktree owner path regex for Windows separators
1 parent 7103da3 commit f330211

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/services/WorktreePoolService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ export class WorktreePoolService {
510510
const resolvedGitWorktreePath = path.isAbsolute(gitWorktreePath)
511511
? gitWorktreePath
512512
: path.resolve(worktreePath, gitWorktreePath);
513-
const mainGitDir = resolvedGitWorktreePath.replace(/[\\/]worktrees[\\/].*$/, '');
514-
return mainGitDir.replace(/[\\/]\\.git$/, '');
513+
const mainGitDir = resolvedGitWorktreePath.replace(/[\\\\/]worktrees[\\\\/].*$/, '');
514+
return mainGitDir.replace(/[\\\\/]\\.git$/, '');
515515
} catch {
516516
return null;
517517
}

0 commit comments

Comments
 (0)