diff options
| author | lhchavez <[email protected]> | 2020-12-04 19:54:26 -0800 |
|---|---|---|
| committer | lhchavez <[email protected]> | 2021-09-05 18:52:01 -0700 |
| commit | b78bde3d74b1617d5b635723552aaec0583eb054 (patch) | |
| tree | 16c98859171b6483b61ac710672694d823db2e1b /cherrypick.go | |
| parent | 5def02a589a2c1653f4bb515fdec290361a222be (diff) | |
Make all Options objects consistent
This change makes all Options objects have child Option fields as values
(instead of pointers) to mirror the libgit2 interface. It also names
them Options instead of Opts to match the current libgit2 nomenclature
and removes the Version fields.
Diffstat (limited to 'cherrypick.go')
| -rw-r--r-- | cherrypick.go | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/cherrypick.go b/cherrypick.go index 5ba57a5..a0ee0f0 100644 --- a/cherrypick.go +++ b/cherrypick.go @@ -9,18 +9,16 @@ import ( ) type CherrypickOptions struct { - Version uint - Mainline uint - MergeOpts MergeOptions - CheckoutOpts CheckoutOptions + Mainline uint + MergeOptions MergeOptions + CheckoutOptions CheckoutOptions } func cherrypickOptionsFromC(c *C.git_cherrypick_options) CherrypickOptions { opts := CherrypickOptions{ - Version: uint(c.version), - Mainline: uint(c.mainline), - MergeOpts: mergeOptionsFromC(&c.merge_opts), - CheckoutOpts: checkoutOptionsFromC(&c.checkout_opts), + Mainline: uint(c.mainline), + MergeOptions: mergeOptionsFromC(&c.merge_opts), + CheckoutOptions: checkoutOptionsFromC(&c.checkout_opts), } return opts } @@ -31,8 +29,8 @@ func populateCherrypickOptions(copts *C.git_cherrypick_options, opts *Cherrypick return nil } copts.mainline = C.uint(opts.Mainline) - populateMergeOptions(&copts.merge_opts, &opts.MergeOpts) - populateCheckoutOptions(&copts.checkout_opts, &opts.CheckoutOpts, errorTarget) + populateMergeOptions(&copts.merge_opts, &opts.MergeOptions) + populateCheckoutOptions(&copts.checkout_opts, &opts.CheckoutOptions, errorTarget) return copts } @@ -82,7 +80,7 @@ func (r *Repository) CherrypickCommit(pick, our *Commit, opts CherrypickOptions) runtime.LockOSThread() defer runtime.UnlockOSThread() - cOpts := populateMergeOptions(&C.git_merge_options{}, &opts.MergeOpts) + cOpts := populateMergeOptions(&C.git_merge_options{}, &opts.MergeOptions) defer freeMergeOptions(cOpts) var ptr *C.git_index |
