I'm getting `reference not found` when I try to clone an empty repository. ``` ... log.Println("Parsing Private Key...") signer, err := ssh.ParsePrivateKey([]byte(GOOGLE_ID_RSA)) if err != nil { log.Printf("Failed to parse key: %s", err.Error()) return } log.Println("Done") auth := &git_ssh.PublicKeys { User: "git", Signer: signer, } auth.HostKeyCallback = ssh.InsecureIgnoreHostKey() clone_path := "/tmp/<reponame>" clone_url := "ssh://<email>@source.developers.google.com:2022/p/<project>/r/<reponame>" log.Printf("Cloning repo '%s' to '%s'...", clone_url, clone_path) repo, err := git.PlainClone(clone_path, false, &git.CloneOptions{ URL: clone_url, Progress: os.Stdout, Auth: auth, }) if err != nil { log.Printf("Failed to clone repo: %s", err.Error()) return } log.Println("Done") log.Println("Getting working tree...") work_tree, err := repo.Worktree() ... ``` Output: ``` 2020/04/06 17:48:05 Decoding JSON... 2020/04/06 17:48:05 Done 2020/04/06 17:48:05 Parsing Private Key... 2020/04/06 17:48:05 Done 2020/04/06 17:48:05 Cloning repo 'ssh://<email>@source.developers.google.com:2022/p/<project>/r/<reponame>' to '/tmp/<reponame>'... 2020/04/06 17:48:06 Failed to clone repo: reference not found ``` I tried it on a different repo with an initial commit committed and it worked fine. This is what I have imported: ``` "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" git_ssh "github.com/go-git/go-git/v5/plumbing/transport/ssh" git_object "github.com/go-git/go-git/v5/plumbing/object" ```
Activity
[-]reference not found[/-][+]PlainClone: reference not found[/+]mcuadros commentedon Apr 7, 2020
BTW
git_ssh.PublicKeys.User==<email>kamiyaa commentedon Apr 7, 2020
Oh my bad haha.
Thanks for the fix!