summaryrefslogtreecommitdiff
path: root/checkout.go
diff options
context:
space:
mode:
authorJesse Ezell <[email protected]>2014-03-26 11:28:48 -0700
committerJesse Ezell <[email protected]>2014-03-26 11:28:48 -0700
commit50a3c4aa0935adb798bc4ecf6612710908d227cf (patch)
tree78c723825cb9b039de6922574f3a2a6840495e3d /checkout.go
parent85420f2002ae85b2e86b3c37c04e462c1cef462a (diff)
update to new merge API
Diffstat (limited to 'checkout.go')
-rw-r--r--checkout.go19
1 files changed, 14 insertions, 5 deletions
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