Skip to content

Commit

Permalink
Merge branch 'th/diff-extra'
Browse files Browse the repository at this point in the history
  • Loading branch information
Junio C Hamano committed Aug 13, 2006
2 parents 647377c + 5faf64c commit f3c5b39
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
7 changes: 0 additions & 7 deletions builtin-diff-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
7 changes: 0 additions & 7 deletions builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
13 changes: 13 additions & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f3c5b39

Please sign in to comment.