Skip to content

Commit 1c85524

Browse files
committed
Merge pull request libgit2#253 from joseferminj/checkout-baseline
Expose baseline field in CheckoutOptions
2 parents ebf7f15 + 9397af0 commit 1c85524

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

checkout.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ type CheckoutOpts struct {
4444
FileMode os.FileMode // Default is 0644 or 0755 as dictated by blob
4545
FileOpenFlags int // Default is O_CREAT | O_TRUNC | O_WRONLY
4646
TargetDirectory string // Alternative checkout path to workdir
47-
Paths []string
47+
Paths []string
48+
Baseline *Tree
4849
}
4950

5051
func checkoutOptionsFromC(c *C.git_checkout_options) CheckoutOpts {
@@ -90,6 +91,10 @@ func populateCheckoutOpts(ptr *C.git_checkout_options, opts *CheckoutOpts) *C.gi
9091
ptr.paths.count = C.size_t(len(opts.Paths))
9192
}
9293

94+
if opts.Baseline != nil {
95+
ptr.baseline = opts.Baseline.cast_ptr
96+
}
97+
9398
return ptr
9499
}
95100

@@ -156,4 +161,4 @@ func (v *Repository) CheckoutTree(tree *Tree, opts *CheckoutOpts) error {
156161
}
157162

158163
return nil
159-
}
164+
}

0 commit comments

Comments
 (0)