Fix erroneous err='' output in worktree rm
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user