X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=diff-helper.c;h=c977a1b8596587995f2ea24c6152ffcb5f3773a1;hb=5831b563a442e7c3198a444a51d8caba4d072506;hp=d64d3baf990c6ecd9fbd6680cfadc1e121984ef2;hpb=81e50eabf06dd68e8e62a9b697eaf60904c58b22;p=git.git diff --git a/diff-helper.c b/diff-helper.c index d64d3baf..c977a1b8 100644 --- a/diff-helper.c +++ b/diff-helper.c @@ -1,7 +1,6 @@ /* * Copyright (C) 2005 Junio C Hamano */ -#include #include "cache.h" #include "strbuf.h" #include "diff.h" @@ -77,11 +76,11 @@ int main(int ac, const char **av) { else if (av[1][1] == 'P') /* hidden from the help */ diff_output_style = DIFF_FORMAT_MACHINE; else if (av[1][1] == 'M') { - detect_rename = 1; + detect_rename = DIFF_DETECT_RENAME; diff_score_opt = diff_scoreopt_parse(av[1]); } else if (av[1][1] == 'C') { - detect_rename = 2; + detect_rename = DIFF_DETECT_COPY; diff_score_opt = diff_scoreopt_parse(av[1]); } else if (av[1][1] == 'S') { @@ -93,7 +92,7 @@ int main(int ac, const char **av) { } /* the remaining parameters are paths patterns */ - diff_setup(reverse_diff, diff_output_style); + diff_setup(reverse_diff); while (1) { int status; read_line(&sb1, stdin, line_termination); @@ -121,14 +120,17 @@ int main(int ac, const char **av) { status = parse_diff_raw(sb1.buf+1, NULL, NULL); if (status) { unrecognized: - diff_flush(av+1, ac-1); - printf("%s%c", sb1.buf, line_termination); + diff_flush(diff_output_style); + printf("%s\n", sb1.buf); } } if (detect_rename) - diff_detect_rename(detect_rename, diff_score_opt); + diffcore_rename(detect_rename, diff_score_opt); + diffcore_prune(); if (pickaxe) - diff_pickaxe(pickaxe); - diff_flush(av+1, ac-1); + diffcore_pickaxe(pickaxe); + if (ac) + diffcore_pathspec(av + 1); + diff_flush(diff_output_style); return 0; }