diff options
| author | Carlos Martín Nieto <[email protected]> | 2014-09-04 17:10:37 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2014-09-04 17:10:37 +0200 |
| commit | 756c8a7e8bc8e4688565634bd1b1889b3e2dcac2 (patch) | |
| tree | df25845c4bb3158d459edc72c7b6dd7c8b9f5e89 | |
| parent | db113288b356835821a751e645b87def6b03fc4a (diff) | |
| parent | ced242954c1c40dc6eedb12ab5fe4443ef1ecbf4 (diff) | |
Merge pull request #116 from calavera/sync_with_libgit2_master
Sync with libgit2 master.
| -rw-r--r-- | clone.go | 27 | ||||
| -rw-r--r-- | tree.go | 3 | ||||
| m--------- | vendor/libgit2 | 0 |
3 files changed, 14 insertions, 16 deletions
@@ -14,10 +14,10 @@ import ( type CloneOptions struct { *CheckoutOpts *RemoteCallbacks - Bare bool - IgnoreCertErrors bool - RemoteName string - CheckoutBranch string + Bare bool + CheckoutBranch string + RemoteCreateCallback C.git_remote_create_cb + RemoteCreatePayload unsafe.Pointer } func Clone(url string, path string, options *CloneOptions) (*Repository, error) { @@ -32,12 +32,6 @@ func Clone(url string, path string, options *CloneOptions) (*Repository, error) var copts C.git_clone_options populateCloneOptions(&copts, options) - // finish populating clone options here so we can defer CString free - if len(options.RemoteName) != 0 { - copts.remote_name = C.CString(options.RemoteName) - defer C.free(unsafe.Pointer(copts.remote_name)) - } - if len(options.CheckoutBranch) != 0 { copts.checkout_branch = C.CString(options.CheckoutBranch) defer C.free(unsafe.Pointer(copts.checkout_branch)) @@ -67,9 +61,14 @@ func populateCloneOptions(ptr *C.git_clone_options, opts *CloneOptions) { } else { ptr.bare = 0 } - if opts.IgnoreCertErrors { - ptr.ignore_cert_errors = 1 - } else { - ptr.ignore_cert_errors = 0 + + if opts.RemoteCreateCallback != nil { + ptr.remote_cb = opts.RemoteCreateCallback + defer C.free(unsafe.Pointer(opts.RemoteCreateCallback)) + + if opts.RemoteCreatePayload != nil { + ptr.remote_cb_payload = opts.RemoteCreatePayload + defer C.free(opts.RemoteCreatePayload) + } } } @@ -16,8 +16,7 @@ import ( type Filemode int const ( - FilemodeNew Filemode = C.GIT_FILEMODE_NEW - FilemodeTree = C.GIT_FILEMODE_TREE + FilemodeTree Filemode = C.GIT_FILEMODE_TREE FilemodeBlob = C.GIT_FILEMODE_BLOB FilemodeBlobExecutable = C.GIT_FILEMODE_BLOB_EXECUTABLE FilemodeLink = C.GIT_FILEMODE_LINK diff --git a/vendor/libgit2 b/vendor/libgit2 -Subproject b4d00c1d2466de3558a7cc6983dce4eb2ee9843 +Subproject 89e05e2ab19ac452e84e0eaa2dfb8e07ac6839b |
