Commit 3bac68ff by Iliyas Jorio Committed by Edward Thomson

diff_file: Apply suggestions from code review

Skip new_file_size non-zero test, custom error message if file changed in workdir

Co-authored-by: Edward Thomson <ethomson@github.com>
parent 0a0cd67d
......@@ -335,12 +335,12 @@ static int diff_file_content_load_workdir_file(
error = git_futils_filesize(&new_file_size, fd);
if (error < 0 || !new_file_size)
if (error < 0)
goto cleanup;
/* if file size doesn't match cached value, abort */
if (fc->file->size && fc->file->size != new_file_size)
{
if (fc->file->size && fc->file->size != new_file_size) {
git_error_set(GIT_ERROR_FILESYSTEM, "file changed before we could read it");
error = -1;
goto cleanup;
}
......
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