aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/diff.c b/diff.c
index dcea405ed..a32078ea0 100644
--- a/diff.c
+++ b/diff.c
@@ -1068,9 +1068,18 @@ static int file_is_binary(struct diff_filespec *one)
struct git_attr_check attr_diff_check;
setup_diff_attr_check(&attr_diff_check);
- if (!git_checkattr(one->path, 1, &attr_diff_check) &&
- (0 <= attr_diff_check.isset))
- return !attr_diff_check.isset;
+ if (!git_checkattr(one->path, 1, &attr_diff_check)) {
+ void *value = attr_diff_check.value;
+ if (ATTR_TRUE(value))
+ return 0;
+ else if (ATTR_FALSE(value))
+ return 1;
+ else if (ATTR_UNSET(value))
+ ;
+ else
+ die("unknown value %s given to 'diff' attribute",
+ (char *)value);
+ }
if (!one->data) {
if (!DIFF_FILE_VALID(one))