embrace static types
This commit is contained in:
parent
e5e9636ce0
commit
2f93ce39cc
18
checkout.go
18
checkout.go
|
@ -98,23 +98,7 @@ func (v *Repository) CheckoutIndex(index *Index, opts *CheckoutOpts) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *Repository) CheckoutTree(treeish string, opts *CheckoutOpts) error {
|
func (v *Repository) CheckoutTree(tree *Tree, opts *CheckoutOpts) error {
|
||||||
obj, err := v.RevparseSingle(treeish)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer obj.Free()
|
|
||||||
|
|
||||||
commit, err := v.LookupCommit(obj.Id())
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
tree, err := commit.Tree()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
runtime.LockOSThread()
|
runtime.LockOSThread()
|
||||||
defer runtime.UnlockOSThread()
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue