if libgit.Features()&libgit.FeatureSSH != 0 {
fmt.Println("libgit2 has SSH support!")
} else {
fmt.Println("libgit2 does not have SSH support.")
}
repo, err := libgit.Clone(repoURL, localPath, &libgit.CloneOptions{})
if err != nil {
return nil, fmt.Errorf("error cloning repository %s to %s: %w", repoURL, localPath, err)
}
defer repo.Free()
The code fails with:
libgit2 has SSH support!
error cloning repository git@github.com/juanique/bazel-examples.git to /home/juanique/ggo/bazel-examples: failed to stat '/home/juanique/ggo/bazel-examples/.git':
I see that the directory /home/juanique/ggo/bazel-examples was created and it's empty.
I don't know if it is relevant but I'm running Ubuntu with WSL2 on Windows and building my go binary using bazel with cgo for the libgit2 dependency.
I'm doing this:
The code fails with:
I see that the directory
/home/juanique/ggo/bazel-examples
was created and it's empty.I don't know if it is relevant but I'm running Ubuntu with WSL2 on Windows and building my go binary using bazel with cgo for the libgit2 dependency.
I'm using
git2go@v33