Skip to content

Commit 15c464e

Browse files
committed
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).
1 parent 15cd2a7 commit 15c464e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ObjectiveGit/GTRepository+Merging.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ - (BOOL)mergeBranchIntoCurrentBranch:(GTBranch *)branch withError:(NSError **)er
139139
// Write conflicts
140140
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
141141
git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
142-
checkout_opts.checkout_strategy = GIT_CHECKOUT_ALLOW_CONFLICTS;
142+
checkout_opts.checkout_strategy = (GIT_CHECKOUT_SAFE | GIT_CHECKOUT_ALLOW_CONFLICTS);
143143

144144
git_annotated_commit *annotatedCommit;
145145
[self annotatedCommit:&annotatedCommit fromCommit:remoteCommit error:error];

0 commit comments

Comments
 (0)