summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--checkout.go2
-rw-r--r--git_test.go7
2 files changed, 7 insertions, 2 deletions
diff --git a/checkout.go b/checkout.go
index 456c302..8974a8c 100644
--- a/checkout.go
+++ b/checkout.go
@@ -55,7 +55,7 @@ func populateCheckoutOpts(ptr *C.git_checkout_options, opts *CheckoutOpts) *C.gi
return nil
}
- C.git_checkout_init_opts(ptr, 1)
+ C.git_checkout_init_options(ptr, 1)
ptr.checkout_strategy = C.uint(opts.Strategy)
ptr.disable_filters = cbool(opts.DisableFilters)
ptr.dir_mode = C.uint(opts.DirMode.Perm())
diff --git a/git_test.go b/git_test.go
index cbf3227..56adeed 100644
--- a/git_test.go
+++ b/git_test.go
@@ -77,10 +77,15 @@ func updateReadme(t *testing.T, repo *Repository, content string) (*Oid, *Oid) {
treeId, err := idx.WriteTree()
checkFatal(t, err)
+ currentBranch, err := repo.Head()
+ checkFatal(t, err)
+ currentTip, err := repo.LookupCommit(currentBranch.Target())
+ checkFatal(t, err)
+
message := "This is a commit\n"
tree, err := repo.LookupTree(treeId)
checkFatal(t, err)
- commitId, err := repo.CreateCommit("HEAD", sig, sig, message, tree)
+ commitId, err := repo.CreateCommit("HEAD", sig, sig, message, tree, currentTip)
checkFatal(t, err)
return commitId, treeId