diff --git a/scripts/wc2wt.sh b/scripts/wc2wt.sh index 157881b458f..b6e92f86934 100755 --- a/scripts/wc2wt.sh +++ b/scripts/wc2wt.sh @@ -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)