Fix mergeBranchIntoCurrentBranch: for conflicted state conditions#604
Fix mergeBranchIntoCurrentBranch: for conflicted state conditions#604slavikus wants to merge 3 commits intolibgit2:masterfrom
Conversation
GTRepositoryStashApplyProgressGheckoutUntracked -> GTRepositoryStashApplyProgressСheckoutUntracked
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).
|
Also added contents of PR #602 as it wasn't accepted earlier, sorry. |
|
Looks like travis has a wrong version of libssh installed, so it fails for macOS builds :( |
|
@tiennou you're best with these, would you please spend a few moments of your precious time on this one? :) |
|
Would you be so kind to rebase that branch onto master ? I'm not fond of twisty histories 😉. Apart from that, LGTM. I have a few concerns on that merge code though, but that's not on you. |
|
@tiennou, will do today. Should I close this pull request and make a new one instead? As for the merge code itself, yep, it could use some improvement (like finding the ancestor at the very least), but I decided to go baby steps. |
|
If that's easier for you, create a new one. Personally, I would just force-push the rebased branch to |
|
Created PR #605 , closing this one. |
checkout_optspassed to libgit2 missed aGIT_CHECKOUT_SAFEstrategy, causing a dry run and only conflicted files being written out to the tree (losing all other non-conflicted ones).This is because libgit2 has a safeguard check in
git_mergecall, auto-addingGIT_CHECKOUT_SAFEwhen nocheckout_optswhere specified, but since the Objective-Git code specifiedGIT_CHECKOUT_ALLOW_CONFLICTSflag, it wasn't applied, causing the behaviour outlined above:checkout_strategy = given_checkout_opts ? given_checkout_opts->checkout_strategy : GIT_CHECKOUT_SAFE;