Fix get_object_or_branch to recognize branches in bare clones used by [sources]#4611
Open
Fix get_object_or_branch to recognize branches in bare clones used by [sources]#4611
get_object_or_branch to recognize branches in bare clones used by [sources]#4611Conversation
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.
I was using
[sources]to point to amainbranch of an unreleased package, but observed things not updating and the manifest using an old clone:Not showing all details here, except for some debug info added by me, but the fact that things error on import indicates that there's a mismatch between the expected and actual version of CompilerCaching.jl.
Looking into this using Claude, it seems like Pkg doesn't recognize my
rev="main"as a branch, so it doesn't consider updating the package. As far as I understand, this happens because (for some reason) the initial bare clone doesn't have the refs thatget_object_or_branchexpects:Note that after an update, the expects refs do appear:
In any case, to support the initial bare clone, this PR adds a check for
heads/refs as well, in addition toremotes/cache/heads/. That fixes the issue for me: