summaryrefslogtreecommitdiff
path: root/builtin-diff-files.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-18 07:32:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-09-18 17:49:03 (GMT)
commit903e09a3ecca8941b32bae08b821545941591348 (patch)
treed91e053a26f3f295e05c3f6e2228d6bb8f5a57ec /builtin-diff-files.c
parent1f5a892e5209be329dda316edb0341066d62e3eb (diff)
downloadgit-903e09a3ecca8941b32bae08b821545941591348.zip
git-903e09a3ecca8941b32bae08b821545941591348.tar.gz
git-903e09a3ecca8941b32bae08b821545941591348.tar.bz2
diff/diff-files: do not use --cc too aggressively
Textual diff output for unmerged paths was too eager to give condensed combined diff. Even though "diff -c" (and "diff-files -c -p") is a request to view combined diff without condensing (otherwise the user would have explicitly asked for --cc, not -c), we showed "--cc" output anyway. 0fe7c1d (built-in diff: assorted updates, 2006-04-29) claimed to be careful about doing this, but its breakage was hidden because back then "git diff" was still a shell script that did not use the codepath it introduced fully. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-diff-files.c')
-rw-r--r--builtin-diff-files.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin-diff-files.c b/builtin-diff-files.c
index 9bf10bb..2b578c7 100644
--- a/builtin-diff-files.c
+++ b/builtin-diff-files.c
@@ -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;