Commit bb9e3797 by Greg Collinge Committed by Etiene Dalcol

merge: reload index before git_merge

If the index in memory is different from the index on the disk,
previously merge would abort with GIT_ECONFLICT.
Reload the index before merging to fix this.

Fixes #4203
parent 46e1dabb
......@@ -3239,6 +3239,9 @@ int git_merge(
assert(repo && their_heads);
git_repository_index(&index, repo);
git_index_read(index, 0);
if (their_heads_len != 1) {
giterr_set(GITERR_MERGE, "can only merge a single branch");
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment