Merge pull request #69 from jezell/clone_opts_init_fix

Clone opts init fix
This commit is contained in:
Carlos Martín Nieto 2014-03-19 03:56:38 +01:00
commit b5ce60925e
2 changed files with 19 additions and 1 deletions

View File

@ -55,7 +55,6 @@ func Clone(url string, path string, options *CloneOptions) (*Repository, error)
}
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)
if opts == nil {

19
clone_test.go Normal file
View File

@ -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)
}