diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2018-06-30 17:12:16 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2018-11-05 15:53:03 +0000 |
commit | dddfff77a49c5cf83d01ec66b09acbf80ef33a13 (patch) | |
tree | c2d0c2d90d595a7e1b9182d27e3ca2db063abb4f | |
parent | 9db66c790d04ee81e838160d2c60c6193daef82f (diff) | |
download | libgit2-dddfff77a49c5cf83d01ec66b09acbf80ef33a13.tar.gz |
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.
-rw-r--r-- | src/apply.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/apply.c b/src/apply.c index fd1d5335a..1a20278c3 100644 --- a/src/apply.c +++ b/src/apply.c @@ -539,6 +539,13 @@ static int git_apply__to_workdir( 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: git_vector_free(&paths); return error; |