From 7c8ed2cff16cca0783ac3a94ab1e8b57d795c283 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 15 Mar 2019 13:50:06 +0800 Subject: [PATCH] Git.vala --- Git.vala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Git.vala b/Git.vala index 07558991..566ad557 100644 --- 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 }; -- 2.39.2