fix: harden git workflow skills with better state handling (#406)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Trevin Chow
2026-03-27 01:04:54 -07:00
committed by GitHub
parent da390a65a2
commit f83305e22a
6 changed files with 392 additions and 63 deletions

View File

@@ -1,12 +1,11 @@
#!/usr/bin/env bash
# clean-gone: List local branches whose remote tracking branch is gone.
# Outputs one branch name per line, or nothing if none found.
# Uses `command git` to bypass aliases and RTK proxies.
set -euo pipefail
# Ensure we have current remote state
command git fetch --prune 2>/dev/null
git fetch --prune 2>/dev/null
# Find branches marked [gone] in tracking info.
# `git branch -vv` output format:
@@ -37,7 +36,7 @@ while IFS= read -r line; do
fi
gone_branches+=("$branch_name")
done < <(command git branch -vv 2>/dev/null | grep ': gone]')
done < <(git branch -vv 2>/dev/null | grep ': gone]')
if [[ ${#gone_branches[@]} -eq 0 ]]; then
echo "__NONE__"