diff --git a/worktree/worktree.plugin.zsh b/worktree/worktree.plugin.zsh index 8dda8fb..a45d8f1 100644 --- a/worktree/worktree.plugin.zsh +++ b/worktree/worktree.plugin.zsh @@ -136,6 +136,7 @@ Manage git worktrees by branch name." wt_list=$(git worktree list --porcelain) local failed=0 local wt_path + local err for branch in "${branches[@]}"; do wt_path=$(echo "$wt_list" | awk -v b="$branch" \ '/^worktree /{ sub(/^worktree /, ""); p=$0 } /^branch refs\/heads\//{ sub(/^branch refs\/heads\//, ""); if($0==b) print p }') @@ -152,7 +153,6 @@ Manage git worktrees by branch name." fi local -a rm_args=() (( force )) && rm_args+=(--force) - local err if err=$(git worktree remove "${rm_args[@]}" "$wt_path" 2>&1); then : elif [[ "$err" == *"working trees containing submodules"* ]]; then