mirror of
https://github.com/obra/superpowers.git
synced 2026-04-22 01:19:04 +08:00
Fix skills auto-update to fetch from tracking branch
Determine and fetch from the current branch's tracking remote instead of hardcoding upstream/origin. This ensures the correct remote is updated regardless of fork/upstream setup. Fixes issue where auto-update wasn't fetching on session start.
This commit is contained in:
@@ -8,8 +8,15 @@ SKILLS_REPO="https://github.com/obra/superpowers-skills.git"
|
||||
if [ -d "$SKILLS_DIR/.git" ]; then
|
||||
cd "$SKILLS_DIR"
|
||||
|
||||
# Fetch upstream (silently)
|
||||
git fetch upstream 2>/dev/null || git fetch origin 2>/dev/null || true
|
||||
# Get the remote name for the current tracking branch
|
||||
TRACKING_REMOTE=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null | cut -d'/' -f1 || echo "")
|
||||
|
||||
# Fetch from tracking remote if set, otherwise try upstream then origin
|
||||
if [ -n "$TRACKING_REMOTE" ]; then
|
||||
git fetch "$TRACKING_REMOTE" 2>/dev/null || true
|
||||
else
|
||||
git fetch upstream 2>/dev/null || git fetch origin 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Check if we can fast-forward
|
||||
LOCAL=$(git rev-parse @ 2>/dev/null || echo "")
|
||||
|
||||
Reference in New Issue
Block a user