xdiff-interface.c: strip newline (and cr) from line before pattern matching
[gitweb.git] / builtin-diff-files.c
index 9bf10bb37e2f56ec2a10239d7419db8fbb641745..2b578c714d36c600107f03b454ed8241dc2d4f19 100644 (file)
@@ -50,7 +50,12 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix)
            3 < rev.max_count)
                usage(diff_files_usage);
 
-       if (rev.max_count == -1 &&
+       /*
+        * "diff-files --base -p" should not combine merges because it
+        * was not asked to.  "diff-files -c -p" should not densify
+        * (the user should ask with "diff-files --cc" explicitly).
+        */
+       if (rev.max_count == -1 && !rev.combine_merges &&
            (rev.diffopt.output_format & DIFF_FORMAT_PATCH))
                rev.combine_merges = rev.dense_combined_merges = 1;