summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-03-18 01:54:04 -0400
committerEdward Thomson <ethomson@microsoft.com>2015-05-11 14:12:27 -0400
commitf78bb2afb3a7f23264c4adf2e9debfa415ca8107 (patch)
treea2143316678e3c3c8eb2e75426c46078d93ece67
parent958950b6e077f09821c164d0897e66eca553375c (diff)
downloadlibgit2-f78bb2afb3a7f23264c4adf2e9debfa415ca8107.tar.gz
stash: return GIT_EMERGECONFLICT on merge conflict
-rw-r--r--src/stash.c4
-rw-r--r--tests/stash/apply.c2
2 files changed, 2 insertions, 4 deletions
diff --git a/src/stash.c b/src/stash.c
index d53c22c4d..e3e025771 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -738,10 +738,8 @@ int git_stash_apply(
&unstashed_index, repo, index_parent_tree, repo_index, index_tree)) < 0)
goto cleanup;
-
- /* TODO: GIT_EMERGECONFLICT */
if (git_index_has_conflicts(unstashed_index)) {
- error = GIT_EUNMERGED;
+ error = GIT_EMERGECONFLICT;
goto cleanup;
}
}
diff --git a/tests/stash/apply.c b/tests/stash/apply.c
index efe7852b8..74416cd95 100644
--- a/tests/stash/apply.c
+++ b/tests/stash/apply.c
@@ -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_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);
assert_status(repo, "what", GIT_STATUS_CURRENT);