Example #1
0
func populateCloneOptions(ptr *C.git_clone_options, opts *CloneOpts) {
	ptr.version = 1

	checkout := C.git_checkout_opts_init()
	populateCheckoutOpts(&checkout, &opts.Checkout)
	ptr.checkout_opts = checkout
}
Example #2
0
// Convert the CheckoutOpts struct to the corresponding C-struct
func populateCheckoutOpts(ptr *C.git_checkout_opts, opts *CheckoutOpts) {
	*ptr = C.git_checkout_opts_init()
	if opts == nil {
		return
	}
	ptr.checkout_strategy = C.uint(opts.Strategy)
	ptr.disable_filters = cbool(opts.DisableFilters)
	ptr.dir_mode = C.uint(opts.DirMode.Perm())
	ptr.file_mode = C.uint(opts.FileMode.Perm())
}