go-git
go-git copied to clipboard
[v4] git.PlainClone: "remote repository is empty" error from a normal repository
I'm doing something super straightforward:
_, err := git.PlainClone(destinationPath, false, &git.CloneOptions{
URL: "https://github.com/kubernetes-sigs/krew-index.git",
})
return err
This returns error remote repository is empty
.
I tried os.MkdirAll(destinationPath, 0755)
ahead of time, but it doesn't make any difference.
This is purely copied from example at https://godoc.org/gopkg.in/src-d/go-git.v4#example-PlainClone so it's surprising it didn't work out of the box.
Having the same problem
Which version are you using? I just executed it with the latest go-git/go-git/v5
and worked. Same URL and code.
Also, will be great if you can open the issue at https://github.com/go-git/go-git, if it still doesn't work. See #1298 and #1295 (comment) for reasons.