Closed savetheclocktower closed 1 year ago
From experimentation, changing the line to
sha = repo.getReferenceTarget(repo.getUpstreamBranch(repo.getHead()))
also appears to work, but I wonder why they wouldn't have simply done that in the first place.
From experimentation, changing the line to
sha = repo.getReferenceTarget(repo.getUpstreamBranch(repo.getHead()))
also appears to work, but I wonder why they wouldn't have simply done that in the first place.
This looks like a fantastic solution! And if that works we should go for it.
No clue why it wouldn't be used originally, but there's been a few things we found like that. Guess hindsight is always 2020, when we now know that master branches can change and won't always be master
as they were for years when that was originally written.
Thanks in advance for your bug report!
What happened?
I was wondering why some of my git-installed packages were able to be upgraded — both within the editor and via
ppm upgrade
— and some were not. I managed to track down what I think is the answer:ppm upgrade
checks a hard-codedrefs/heads/master
, and many newer repos usemain
as the default branch.GitHub changed the default on new repos back in 2020, but never updated
apm
accordingly.I suppose the simplest fix would be to do
repo.getUpstreamBranch('refs/heads/main') || repo.getUpstreamBranch('refs/heads/master')
, so that’s probably what I’ll do unless someone has a better suggestion.Pulsar version
1.101.0-beta
Which OS does this happen on?
🍎 macOS
OS details
11.7.3
Which CPU architecture are you running this on?
64-bit(x86_64)
What steps are needed to reproduce this?
I don't expect anyone to do this, but here we go:
main
as its default branch. Put a skeleton package in it — perhaps a sample package from the Flight Manual.ppm install [github username]/[repo name]
.main
.ppm upgrade [repo name]
; nothing will happen.Additional Information:
No response