]> git.proxmox.com Git - libgit2.git/commitdiff
stash: return GIT_EMERGECONFLICT on merge conflict
authorEdward Thomson <ethomson@microsoft.com>
Wed, 18 Mar 2015 05:54:04 +0000 (01:54 -0400)
committerEdward Thomson <ethomson@microsoft.com>
Mon, 11 May 2015 18:12:27 +0000 (14:12 -0400)
src/stash.c
tests/stash/apply.c

index d53c22c4d72eea70716ead3136d688d76c46f538..e3e0257719c7d8e073efd3f04f691290c107be3a 100644 (file)
@@ -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;
                }
        }
index efe7852b8ced6f61d6b399b1f90e074c1b38b81f..74416cd950a9772962b78bd408675b6cb30bc53e 100644 (file)
@@ -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);