diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/diff.c | 3 | ||||
-rw-r--r-- | src/diff_output.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/diff.c b/src/diff.c index a5bf07a65..9abf8b9f5 100644 --- a/src/diff.c +++ b/src/diff.c @@ -470,7 +470,8 @@ static int maybe_modified( /* on platforms with no symlinks, preserve mode of existing symlinks */ if (S_ISLNK(omode) && S_ISREG(nmode) && - !(diff->diffcaps & GIT_DIFFCAPS_HAS_SYMLINKS)) + !(diff->diffcaps & GIT_DIFFCAPS_HAS_SYMLINKS) && + new_iter->type == GIT_ITERATOR_WORKDIR) nmode = omode; /* on platforms with no execmode, just preserve old mode */ diff --git a/src/diff_output.c b/src/diff_output.c index bd8e8edda..d269a4cee 100644 --- a/src/diff_output.c +++ b/src/diff_output.c @@ -162,7 +162,7 @@ static int file_is_binary_by_attr( mirror_new = (delta->new_file.path == delta->old_file.path || strcmp(delta->new_file.path, delta->old_file.path) == 0); if (mirror_new) - delta->new_file.flags &= (delta->old_file.flags & BINARY_DIFF_FLAGS); + delta->new_file.flags |= (delta->old_file.flags & BINARY_DIFF_FLAGS); else error = update_file_is_binary_by_attr(diff->repo, &delta->new_file); @@ -397,6 +397,7 @@ int git_diff_foreach( if (error < 0) goto cleanup; + delta->new_file.flags |= GIT_DIFF_FILE_VALID_OID; /* since we did not have the definitive oid, we may have * incorrect status and need to skip this item. |