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 commits = new Ggit.Commit[] { master_commit };
+
+ this.repo.merge(commits, mo, co);
+ /*
+ if (ix.has_conflicts()) {
+ GLib.debug("merge has conflicts");
+ return;
+ }
+
+ var cfg = this.repo.get_config().snapshot();
+ var sig = new Ggit.Signature.now(
+ cfg.get_string("user.name"),
+ cfg.get_string("user.email")
+ );
+
+ var parents = new Ggit.OId[] { anc_commit.get_id() };
+
+ var treeoid = ix.write_tree_to(this.repo);
+
+ this.repo.create_commit_from_ids("HEAD",
+ sig, sig, null, "Test Merge", treeoid, parents);
+
+ /*
var master_tree = master_commit.get_tree();
var head_tree = head_commit.get_tree();
var mo = new Ggit.MergeOptions();
var ix = this.repo.merge_trees(anc_tree, master_tree, head_tree, mo);
// might be conflicts..
- if (ix.has_conflicts()) {
- GLib.debug("merge has conflicts");
- return;
- }
this.repo.checkout_index(ix, new Ggit.CheckoutOptions());
var treeoid = ix.write_tree();
var new_tree = this.repo.lookup(treeoid,typeof (Ggit.Tree)) as Ggit.Tree;
- var sig = new Ggit.Signature.now(
- this.repo.get_config().get_string("user.name"),
- this.repo.get_config().get_string("user.email")
- );
+ );
this.repo.create_commit("HEAD", sig, sig, null, "Test Merge", new_tree, parents);
-
+ */
}