Open bobg opened 1 year ago
Is this issue #148?
If it is a workaround is to add this line after your PlainOpen:
_, _ = repo.ResolveRevision(plumbing.Revision(plumbing.ZeroHash.String()))
I have a PR open to fix it.
Thank you @AriehSchneier but apparently not. I tried your workaround and got the same result.
On the other hand, this workaround (using an https repo URL instead of a local directory) did work.
[It's not a
fetch-depth
problem.]Hello! I have some code that calls
PlainCloneContext
with a local.git
dir as theURL
. It works fine when I run it on my Macbook, and when I run it on my Linux desktop. And it worked fine in GitHub Actions in a recent version of my project. But it fails on my current feature branch, even though no relevant code has changed.The project is modver, a package and command-line tool for helping your Go project to obey semantic versioning rules. In the function CompareGitWith, an older and a newer version of a Git repo are compared to each other; the cloning happens in the helper function
gitSetup
here.Here is the line in the
TestGit
unit test that callsCompareGitWith
(via an intermediate call toCompareGit
). Here is the GitHub Actions workflow that runs that test. And here you can see it working in a commit on themaster
branch from just a few weeks ago.But it's failing in this draft PR with an "object not found" error. Example.
Take a look at the last several commits in that PR branch to see the various permutations of things I tried to fix this, to no avail. I am pretty baffled. Any help?