diff options
| author | Mark Probst <[email protected]> | 2015-03-04 11:38:19 -0800 |
|---|---|---|
| committer | Mark Probst <[email protected]> | 2015-03-04 15:52:54 -0800 |
| commit | c78b4d665e406af7e8cba608f65ac2171d3917b6 (patch) | |
| tree | e37a40954d28fc7bd397f6f4596ab0535e0d371b /checkout.go | |
| parent | 56ed0b22d7f7ab6185f14e0054346da3ca33c4fa (diff) | |
Cherrypick
Diffstat (limited to 'checkout.go')
| -rw-r--r-- | checkout.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/checkout.go b/checkout.go index 72a1fe3..6eb6098 100644 --- a/checkout.go +++ b/checkout.go @@ -40,6 +40,19 @@ type CheckoutOpts struct { TargetDirectory string // Alternative checkout path to workdir } +func checkoutOptionsFromC(c *C.git_checkout_options) CheckoutOpts { + opts := CheckoutOpts{} + opts.Strategy = CheckoutStrategy(c.checkout_strategy) + opts.DisableFilters = c.disable_filters != 0 + opts.DirMode = os.FileMode(c.dir_mode) + opts.FileMode = os.FileMode(c.file_mode) + opts.FileOpenFlags = int(c.file_open_flags) + if c.target_directory != nil { + opts.TargetDirectory = C.GoString(c.target_directory) + } + return opts +} + func (opts *CheckoutOpts) toC() *C.git_checkout_options { if opts == nil { return nil |
