diff options
author | Junio C Hamano <junkio@cox.net> | 2006-08-13 06:34:41 +0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-08-13 06:34:41 +0400 |
commit | f3c5b39567535a41a371aad8a6affbeea0d4c0b9 (patch) | |
tree | c83f5d4be58e296f3eb90a4be13782d48e5713ad | |
parent | 647377c4c91064fc5001acddd5357467c0da6ef9 (diff) | |
parent | 5faf64cd28bf79f0c2939717d2ba117498717059 (diff) |
Merge branch 'th/diff-extra'
-rw-r--r-- | builtin-diff-files.c | 7 | ||||
-rw-r--r-- | builtin-diff.c | 7 | ||||
-rw-r--r-- | diff.c | 13 |
3 files changed, 13 insertions, 14 deletions
diff --git a/builtin-diff-files.c b/builtin-diff-files.c index ac13db70ff..5d4a5c5828 100644 --- a/builtin-diff-files.c +++ b/builtin-diff-files.c @@ -47,12 +47,5 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix) if (rev.pending.nr || rev.min_age != -1 || rev.max_age != -1) usage(diff_files_usage); - /* - * Backward compatibility wart - "diff-files -s" used to - * defeat the common diff option "-s" which asked for - * DIFF_FORMAT_NO_OUTPUT. - */ - if (rev.diffopt.output_format == DIFF_FORMAT_NO_OUTPUT) - rev.diffopt.output_format = DIFF_FORMAT_RAW; return run_diff_files(&rev, silent); } diff --git a/builtin-diff.c b/builtin-diff.c index a090e298a5..82afce782d 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -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); } @@ -1679,6 +1679,19 @@ void diff_setup(struct diff_options *options) int diff_setup_done(struct diff_options *options) { + int count = 0; + + if (options->output_format & DIFF_FORMAT_NAME) + count++; + if (options->output_format & DIFF_FORMAT_NAME_STATUS) + count++; + if (options->output_format & DIFF_FORMAT_CHECKDIFF) + count++; + if (options->output_format & DIFF_FORMAT_NO_OUTPUT) + count++; + if (count > 1) + die("--name-only, --name-status, --check and -s are mutually exclusive"); + if (options->find_copies_harder) options->detect_rename = DIFF_DETECT_COPY; |