diff options
| author | Jason Toffaletti <[email protected]> | 2014-01-06 20:05:35 +0000 |
|---|---|---|
| committer | Jason Toffaletti <[email protected]> | 2014-01-06 20:05:35 +0000 |
| commit | 32bf5f0a234e0c3cd00dc8eec349ee820f765f19 (patch) | |
| tree | f118a770bb7eb0cd83a049a80f8cce3975489143 /clone.go | |
| parent | d1245446685ccdc632b6a9cee65391cbe4eac4df (diff) | |
wip wrapping git_remote
Diffstat (limited to 'clone.go')
| -rw-r--r-- | clone.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -37,6 +37,17 @@ 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)) + } + runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_clone(&repo.ptr, curl, cpath, &copts) |
