Commit f78bb2af by Edward Thomson

stash: return GIT_EMERGECONFLICT on merge conflict

parent 958950b6
...@@ -738,10 +738,8 @@ int git_stash_apply( ...@@ -738,10 +738,8 @@ int git_stash_apply(
&unstashed_index, repo, index_parent_tree, repo_index, index_tree)) < 0) &unstashed_index, repo, index_parent_tree, repo_index, index_tree)) < 0)
goto cleanup; goto cleanup;
/* TODO: GIT_EMERGECONFLICT */
if (git_index_has_conflicts(unstashed_index)) { if (git_index_has_conflicts(unstashed_index)) {
error = GIT_EUNMERGED; error = GIT_EMERGECONFLICT;
goto cleanup; goto cleanup;
} }
} }
......
...@@ -108,7 +108,7 @@ void test_stash_apply__conflict_index_with_reinstate_index(void) ...@@ -108,7 +108,7 @@ void test_stash_apply__conflict_index_with_reinstate_index(void)
cl_git_pass(git_index_add_bypath(repo_index, "who")); cl_git_pass(git_index_add_bypath(repo_index, "who"));
cl_git_pass(git_index_write(repo_index)); cl_git_pass(git_index_write(repo_index));
cl_git_fail_with(git_stash_apply(repo, 0, NULL, GIT_APPLY_REINSTATE_INDEX), GIT_EUNMERGED); cl_git_fail_with(git_stash_apply(repo, 0, NULL, GIT_APPLY_REINSTATE_INDEX), GIT_EMERGECONFLICT);
cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); cl_assert_equal_i(git_index_has_conflicts(repo_index), 0);
assert_status(repo, "what", GIT_STATUS_CURRENT); assert_status(repo, "what", GIT_STATUS_CURRENT);
......
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