summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-03-19 03:56:38 +0100
committerCarlos Martín Nieto <[email protected]>2014-03-19 03:56:38 +0100
commitb5ce60925e1e31f83e55a575cbf3b79a6199cfbb (patch)
tree3cf7e054605f76427d422643e12f7e6b957e994b
parent5f35f137372917332cd329cf723a9d005e13d582 (diff)
parentf1f0fa7335f6ec3285eae32f84d143edffd73ef5 (diff)
Merge pull request #69 from jezell/clone_opts_init_fix
Clone opts init fix
-rw-r--r--clone.go1
-rw-r--r--clone_test.go19
2 files changed, 19 insertions, 1 deletions
diff --git a/clone.go b/clone.go
index c2abbe5..1bc3261 100644
--- a/clone.go
+++ b/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) {
- ptr = &C.git_clone_options{}
C.git_clone_init_options(ptr, C.GIT_CLONE_OPTIONS_VERSION)
if opts == nil {
diff --git a/clone_test.go b/clone_test.go
new file mode 100644
index 0000000..6145228
--- /dev/null
+++ b/clone_test.go
@@ -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)
+}