Git.vala
authorAlan Knowles <alan@roojs.com>
Fri, 15 Mar 2019 05:50:06 +0000 (13:50 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 15 Mar 2019 05:50:06 +0000 (13:50 +0800)
Git.vala

index 0755899..566ad55 100644 (file)
--- a/Git.vala
+++ b/Git.vala
@@ -211,10 +211,15 @@ namespace  GitLive {
                        var mo = new Ggit.MergeOptions();
                        mo.set_file_favor(Ggit.MergeFileFavor.THEIRS);
                        var ix  = this.repo.merge_trees(anc_tree, master_tree, head_tree, mo);
-                       ix.write();
+                       
+                       // 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 parents =   new Ggit.Commit[] { master_commit };