From 9eefffc5417a8ee7096e646e573e82ebb64c41c3 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 11 Oct 2025 14:06:29 -0700 Subject: 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. --- lib/initialize-skills.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/initialize-skills.sh b/lib/initialize-skills.sh index b3f99e2..3fb3fd8 100755 --- a/lib/initialize-skills.sh +++ b/lib/initialize-skills.sh @@ -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 "") -- cgit