scripts : allow wc2wt with an existing branch (#23189)
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ dir=$(basename $(pwd))
|
|||||||
# sanitize branch name for directory name (replace / with -)
|
# sanitize branch name for directory name (replace / with -)
|
||||||
dir_suffix=$(echo "$BRANCH" | tr '/' '-')
|
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)
|
og_path=$(pwd)
|
||||||
wt_path=$(cd "../$dir-$dir_suffix" && pwd)
|
wt_path=$(cd "../$dir-$dir_suffix" && pwd)
|
||||||
|
|||||||
Reference in New Issue
Block a user