From 50a3c4aa0935adb798bc4ecf6612710908d227cf Mon Sep 17 00:00:00 2001 From: Jesse Ezell Date: Wed, 26 Mar 2014 11:28:48 -0700 Subject: update to new merge API --- checkout.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'checkout.go') diff --git a/checkout.go b/checkout.go index 5b72b9a..456c302 100644 --- a/checkout.go +++ b/checkout.go @@ -5,8 +5,8 @@ package git */ import "C" import ( - "runtime" "os" + "runtime" ) type CheckoutStrategy uint @@ -32,10 +32,19 @@ const ( type CheckoutOpts struct { Strategy CheckoutStrategy // Default will be a dry run - DisableFilters bool // Don't apply filters like CRLF conversion - DirMode os.FileMode // Default is 0755 - FileMode os.FileMode // Default is 0644 or 0755 as dictated by blob - FileOpenFlags int // Default is O_CREAT | O_TRUNC | O_WRONLY + DisableFilters bool // Don't apply filters like CRLF conversion + DirMode os.FileMode // Default is 0755 + FileMode os.FileMode // Default is 0644 or 0755 as dictated by blob + FileOpenFlags int // Default is O_CREAT | O_TRUNC | O_WRONLY +} + +func (opts *CheckoutOpts) toC() *C.git_checkout_options { + if opts == nil { + return nil + } + c := C.git_checkout_options{} + populateCheckoutOpts(&c, opts) + return &c } // Convert the CheckoutOpts struct to the corresponding -- cgit v1.2.3