From 15c464ebcdcb41d156b3e21a013774cb9e2c5ead Mon Sep 17 00:00:00 2001 From: Slava Karpenko Date: Thu, 15 Dec 2016 16:22:43 +0300 Subject: [PATCH] Fix mergeBranchIntoCurrentBranch for conflicted state checkout_opts passed to libgit2 missed a GIT_CHECKOUT_SAFE strategy, causing a dry run and only conflicted files being written out to the tree (losing all other non-conflicted ones). --- ObjectiveGit/GTRepository+Merging.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ObjectiveGit/GTRepository+Merging.m b/ObjectiveGit/GTRepository+Merging.m index aa4169e17..bb0c1fbb5 100644 --- a/ObjectiveGit/GTRepository+Merging.m +++ b/ObjectiveGit/GTRepository+Merging.m @@ -139,7 +139,7 @@ - (BOOL)mergeBranchIntoCurrentBranch:(GTBranch *)branch withError:(NSError **)er // Write conflicts git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT; git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; - checkout_opts.checkout_strategy = GIT_CHECKOUT_ALLOW_CONFLICTS; + checkout_opts.checkout_strategy = (GIT_CHECKOUT_SAFE | GIT_CHECKOUT_ALLOW_CONFLICTS); git_annotated_commit *annotatedCommit; [self annotatedCommit:&annotatedCommit fromCommit:remoteCommit error:error];