Commit dddfff77 by Edward Thomson

apply: convert checkout conflicts to apply failures

When there's a checkout conflict during apply, that means that the
working directory was modified in a conflicting manner and the postimage
cannot be written.  During application, convert this to an application
failure for consistency across workdir/index/both applications.
parent 9db66c79
...@@ -539,6 +539,13 @@ static int git_apply__to_workdir( ...@@ -539,6 +539,13 @@ static int git_apply__to_workdir(
error = git_checkout_index(repo, postimage, &checkout_opts); error = git_checkout_index(repo, postimage, &checkout_opts);
/*
* When there's a checkout conflict, the file in the working directory
* has been modified. Upgrade this error to an application error.
*/
if (error == GIT_ECONFLICT)
error = GIT_EAPPLYFAIL;
done: done:
git_vector_free(&paths); git_vector_free(&paths);
return error; return error;
......
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