fix: detect remote changes by checking repo's default branch first#660
Open
elliotllliu wants to merge 1 commit intovercel-labs:mainfrom
Open
fix: detect remote changes by checking repo's default branch first#660elliotllliu wants to merge 1 commit intovercel-labs:mainfrom
elliotllliu wants to merge 1 commit intovercel-labs:mainfrom
Conversation
`skills update` always reported 'up to date' because `fetchSkillFolderHash` hardcoded branch order as ['main', 'master']. When a repo uses 'master' as default but also has a 'main' branch, the function would return the stale hash from 'main' instead of the updated hash from 'master'. Fix: query the GitHub API for the repo's default branch and check that first. Also adds: - Leading './' normalization for path matching - Truncated tree fallback (walk path segments individually) Fixes vercel-labs#484
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #484 —
skills updatealways reported "All skills are up to date" even when the remote had changed.Root Cause
fetchSkillFolderHash()hardcoded branch order as['main', 'master']. When a repo usesmasteras its default branch but also has amainbranch, the function returns the stale hash frommaininstead of checkingmasterwhere the actual changes were pushed.Fix
GET /repos/{owner}/{repo}) and check that branch first./for API matchingTesting
masteras default branch now correctly detect updatesmainas default continue to workdevelop) are also supported