summaryrefslogtreecommitdiff
path: root/src/diff_output.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-08-22 13:57:57 -0700
committerRussell Belfer <rb@github.com>2012-08-22 13:57:57 -0700
commit5fdc41e76591aebdbae3b49440bc2c8b2430718c (patch)
treea879ae6630a4cde62aa3b06dea4d74c673a16a2c /src/diff_output.c
parentcfda29e38260f19e77f1746c4f6f1c2cab453934 (diff)
downloadlibgit2-5fdc41e76591aebdbae3b49440bc2c8b2430718c.tar.gz
Minor bug fixes in diff code
In looking at PR #878, I found a few small bugs in the diff code, mostly related to work that can be avoided when processing tree- to-tree diffs that was always being carried out. This commit has some small fixes in it.
Diffstat (limited to 'src/diff_output.c')
-rw-r--r--src/diff_output.c3
1 files changed, 2 insertions, 1 deletions
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.