fix: use absolute path for worktree to prevent nested worktrees

This commit is contained in:
shokollm
2026-03-27 13:24:25 +00:00
parent 6102022be0
commit 2010275dda
2 changed files with 422 additions and 1 deletions

View File

@@ -98,7 +98,9 @@ create_worktree() {
branch_name="$worktree_name"
fi
local worktree_path="$WORKTREE_BASE/$worktree_name"
local worktree_path_abs
worktree_path_abs="$(cd "$WORKTREE_BASE" && pwd)/$worktree_name"
local worktree_path="$worktree_path_abs"
# Cleanup any existing with same name
if [[ -d "$worktree_path" ]]; then