File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -338,15 +338,15 @@ static int diff_file_content_load_workdir_file(
338338 if (error < 0 )
339339 goto cleanup ;
340340
341- /* if file size doesn't match cached value, abort */
342- if (fc -> file -> size && fc -> file -> size != new_file_size ) {
341+ if (!(fc -> file -> flags & GIT_DIFF_FLAG_VALID_SIZE )) {
342+ fc -> file -> size = new_file_size ;
343+ fc -> file -> flags |= GIT_DIFF_FLAG_VALID_SIZE ;
344+ } else if (fc -> file -> size != new_file_size ) {
343345 git_error_set (GIT_ERROR_FILESYSTEM , "file changed before we could read it" );
344346 error = -1 ;
345347 goto cleanup ;
346348 }
347349
348- fc -> file -> size = new_file_size ;
349-
350350 if ((diff_opts -> flags & GIT_DIFF_SHOW_BINARY ) == 0 &&
351351 diff_file_content_binary_by_size (fc ))
352352 goto cleanup ;
You can’t perform that action at this time.
0 commit comments