Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

[v4] git.PlainClone: "remote repository is empty" error from a normal repository #1296

Open
ahmetb opened this issue Mar 6, 2020 · 2 comments

Comments

@ahmetb
Copy link

ahmetb commented Mar 6, 2020

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.

@kamiyaa
Copy link

kamiyaa commented Apr 6, 2020

Having the same problem

@mcuadros
Copy link
Contributor

mcuadros commented Apr 6, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants