scripts : allow wc2wt with an existing branch (#23189)

This commit is contained in:
Georgi Gerganov
2026-05-18 08:57:28 +03:00
committed by GitHub
parent 0caf2a1d48
commit c3f95c1f06
+1 -1
View File
@@ -37,7 +37,7 @@ dir=$(basename $(pwd))
# sanitize branch name for directory name (replace / with -)
dir_suffix=$(echo "$BRANCH" | tr '/' '-')
git worktree add -b "$BRANCH" "../$dir-$dir_suffix" HEAD
git worktree add "../$dir-$dir_suffix" "$BRANCH" || git worktree add -b "$BRANCH" "../$dir-$dir_suffix" HEAD
og_path=$(pwd)
wt_path=$(cd "../$dir-$dir_suffix" && pwd)