summaryrefslogtreecommitdiff
path: root/checkout.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-04-26 20:42:18 +0200
committerCarlos Martín Nieto <[email protected]>2014-04-26 20:42:18 +0200
commit4df7eb516c7c73f82a62a8bdb2ac33f2b73ab981 (patch)
tree3291dab43f1937316037a27380e8fe610f6ada90 /checkout.go
parent57f14a25914b431a9034b252314edf74cf7eecbf (diff)
parent9d8cbe7547d499fefb69bf42e975a2f7e8e7fca4 (diff)
Merge pull request #63 from jezell/jezell/merge
Merge functions (in progress)
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