enhance checkout, add CheckoutTree method #113

Merged
CMGS merged 2 commits from master into master 2014-09-04 09:02:21 -05:00
1 changed files with 1 additions and 17 deletions
Showing only changes of commit 2f93ce39cc - Show all commits

View File

@ -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()