Merge pull request #69 from jezell/clone_opts_init_fix
Clone opts init fix
This commit is contained in:
commit
b5ce60925e
1
clone.go
1
clone.go
|
@ -55,7 +55,6 @@ func Clone(url string, path string, options *CloneOptions) (*Repository, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func populateCloneOptions(ptr *C.git_clone_options, opts *CloneOptions) {
|
func populateCloneOptions(ptr *C.git_clone_options, opts *CloneOptions) {
|
||||||
ptr = &C.git_clone_options{}
|
|
||||||
C.git_clone_init_options(ptr, C.GIT_CLONE_OPTIONS_VERSION)
|
C.git_clone_init_options(ptr, C.GIT_CLONE_OPTIONS_VERSION)
|
||||||
|
|
||||||
if opts == nil {
|
if opts == nil {
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package git
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io/ioutil"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestClone(t *testing.T) {
|
||||||
|
|
||||||
|
repo := createTestRepo(t)
|
||||||
|
seedTestRepo(t, repo)
|
||||||
|
|
||||||
|
path, err := ioutil.TempDir("", "git2go")
|
||||||
|
checkFatal(t, err)
|
||||||
|
|
||||||
|
_, err = Clone(repo.Path(), path, &CloneOptions{Bare: true})
|
||||||
|
|
||||||
|
checkFatal(t, err)
|
||||||
|
}
|
Loading…
Reference in New Issue