Commit 5b66b667 by Edward Thomson

apply: when preimage file is missing, return EAPPLYFAIL

The preimage file being missing entirely is simply a case of an
application failure; return the correct error value for the caller.
parent e0224121
......@@ -409,8 +409,14 @@ static int apply_one(
if (delta->status != GIT_DELTA_ADDED) {
if ((error = git_reader_read(&pre_contents,
preimage_reader, delta->old_file.path)) < 0)
preimage_reader, delta->old_file.path)) < 0) {
/* ENOTFOUND is really an application error */
if (error == GIT_ENOTFOUND)
error = GIT_EAPPLYFAIL;
goto done;
}
}
if ((error = git_apply__patch(&post_contents, &filename, &mode,
......
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