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.
This commit is contained in:
1 file changed
+1
@@ -40,6 +40,7 @@ wt() {
|
|||||||
;;
|
;;
|
||||||
sync)
|
sync)
|
||||||
gt --cwd "$primary" sync "${@:2}" || return
|
gt --cwd "$primary" sync "${@:2}" || return
|
||||||
|
git -C "$primary" worktree prune
|
||||||
local line branch merged failed=()
|
local line branch merged failed=()
|
||||||
merged=(${(f)"$(jq -r '.prInfos[] | select(.state == "MERGED") | .headRefName' \
|
merged=(${(f)"$(jq -r '.prInfos[] | select(.state == "MERGED") | .headRefName' \
|
||||||
"$primary/.git/.graphite_pr_info" 2>/dev/null)"})
|
"$primary/.git/.graphite_pr_info" 2>/dev/null)"})
|
||||||
|
|||||||
Reference in new issue
Block a user