When polecats run 'gt done' without --cleanup-status, the witness may prematurely nuke the worktree before the refinery can merge. This fix auto-detects git state: - uncommitted: has uncommitted changes - stash: has stashed changes - unpushed: branch not pushed or has unpushed commits - clean: everything pushed Uses BranchPushedToRemote() which properly handles polecat branches that don't have upstream tracking (compares against origin/main). On error, defaults to 'unpushed' to prevent accidental data loss. Fixes: #342 Co-authored-by: mayor <mayor@gastown.local>
18 KiB
18 KiB