merge-recursive: separate out xdl_merge() interface.
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index e4efb657e8ad8d30d7f0d25b17350fe19840e449..a32078ea0177cb2a57e4a470bf6e50c81d6dd70d 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1068,9 +1068,19 @@ 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 1;
+       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))
                        return 0;