Code

gitweb: bugfix: commitdiff regression
[git.git] / builtin-diff.c
index a090e298a55ef110a6fdd0e0dde54ea744a52f76..40e5c96f30e3d638c09b276805158bdba3ddde58 100644 (file)
@@ -56,13 +56,6 @@ static int builtin_diff_files(struct rev_info *revs,
        if (revs->max_count < 0 &&
            (revs->diffopt.output_format & DIFF_FORMAT_PATCH))
                revs->combine_merges = revs->dense_combined_merges = 1;
-       /*
-        * Backward compatibility wart - "diff-files -s" used to
-        * defeat the common diff option "-s" which asked for
-        * DIFF_FORMAT_NO_OUTPUT.
-        */
-       if (revs->diffopt.output_format == DIFF_FORMAT_NO_OUTPUT)
-               revs->diffopt.output_format = DIFF_FORMAT_RAW;
        return run_diff_files(revs, silent);
 }
 
@@ -75,8 +68,7 @@ static void stuff_change(struct diff_options *opt,
 {
        struct diff_filespec *one, *two;
 
-       if (memcmp(null_sha1, old_sha1, 20) &&
-           memcmp(null_sha1, new_sha1, 20) &&
+       if (!is_null_sha1(old_sha1) && !is_null_sha1(new_sha1) &&
            !memcmp(old_sha1, new_sha1, 20))
                return;