+ var anc_commit = this.repo.lookup_commit(anc_oid);
+ var anc_tree = anc_commit.get_tree();
+
+ var mo = new Ggit.MergeOptions();
+ var co = new Ggit.CheckoutOptions();
+ var the_ref = this.repo.lookup_reference_dwim("refs/heads/master");
+
+ var ac = new Ggit.AnnotatedCommit.from_ref(this.repo, the_ref);
+
+ var commits = new Ggit.AnnotatedCommit[] { ac };
+
+ this.repo.merge(commits, mo, co);
+
+ var cfg = this.repo.get_config().snapshot();
+
+ var sig = new Ggit.Signature.now(
+ cfg.get_string("user.name"),
+ cfg.get_string("user.email")
+ );
+ var new_head = this.repo.get_head();
+ var oid = new_head.get_target();
+
+ var ix = this.repo.get_index();
+
+ ix.write();
+ var treeoid = ix.write_tree();
+
+ var new_tree = this.repo.lookup(treeoid,typeof (Ggit.Tree)) as Ggit.Tree;
+
+ var parent = new_head.lookup() as Ggit.Commit;
+ Ggit.Commit[] parents = new Ggit.Commit[] { parent };
+
+ this.repo.create_commit("refs/heads/" + this.head.get_name(), sig, sig, null, "Test Merge", new_tree, parents);
+