From b71a5d38a46d6426ca55383cc339396cd0a0464a Mon Sep 17 00:00:00 2001 From: Hans Elizaga Date: Fri, 19 Dec 2025 14:27:44 -0800 Subject: [PATCH] fix: improve error handling in remove_worktree function --- lib/core.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/core.sh b/lib/core.sh index 28e50f7..057b122 100644 --- a/lib/core.sh +++ b/lib/core.sh @@ -423,11 +423,16 @@ remove_worktree() { force_flag="--force" fi - if git worktree remove $force_flag "$worktree_path" 2>/dev/null; then + local remove_output + if remove_output=$(git worktree remove $force_flag "$worktree_path" 2>&1); then log_info "Worktree removed: $worktree_path" return 0 else - log_error "Failed to remove worktree" + if [ -n "$remove_output" ]; then + log_error "Failed to remove worktree: $remove_output" + else + log_error "Failed to remove worktree" + fi return 1 fi }