From 5d51af4189df91905fc35a4552009c390dcdff7a Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Tue, 24 Nov 2026 17:29:46 +0100 Subject: [PATCH] pinwheel: Prune deleted worktrees in `wt sync` A worktree whose directory was deleted by hand stays registered in git, so `wt sync` ran `gt restack` in a directory that no longer existed and reported the worktree as failed. It now runs `git worktree prune` before going through the worktrees, which drops only entries whose directory is gone. --- hosts/pinwheel/modules/work/wt.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/pinwheel/modules/work/wt.zsh b/hosts/pinwheel/modules/work/wt.zsh index 12451d7..803d757 100644 --- a/hosts/pinwheel/modules/work/wt.zsh +++ b/hosts/pinwheel/modules/work/wt.zsh @@ -40,6 +40,7 @@ wt() { ;; sync) gt --cwd "$primary" sync "${@:2}" || return + git -C "$primary" worktree prune local line branch merged failed=() merged=(${(f)"$(jq -r '.prInfos[] | select(.state == "MERGED") | .headRefName' \ "$primary/.git/.graphite_pr_info" 2>/dev/null)"})