diff-parseopt: convert --find-copies-harder
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Thu, 21 Feb 2019 11:16:17 +0000 (18:16 +0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Feb 2019 23:16:59 +0000 (15:16 -0800)
--no-find-copies-harder is also added on purpose (because I don't see
why we should not have the --no- version for this)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
diff --git a/diff.c b/diff.c
index 35bac115cc29e77ee02c7f85ff012a1990b38050..abb1566f95711382637b713c413d7098665b562d 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -5085,6 +5085,8 @@ static void prep_parse_options(struct diff_options *options)
                               N_("detect copies"),
                               PARSE_OPT_NONEG | PARSE_OPT_OPTARG,
                               diff_opt_find_copies),
+               OPT_BOOL(0, "find-copies-harder", &options->flags.find_copies_harder,
+                        N_("use unmodified files as source to find copies")),
 
                OPT_GROUP(N_("Diff other options")),
                { OPTION_CALLBACK, 0, "output", options, N_("<file>"),
@@ -5191,8 +5193,6 @@ int diff_opt_parse(struct diff_options *options,
                options->flags.text = 1;
        else if (!strcmp(arg, "-R"))
                options->flags.reverse_diff = 1;
-       else if (!strcmp(arg, "--find-copies-harder"))
-               options->flags.find_copies_harder = 1;
        else if (!strcmp(arg, "--follow"))
                options->flags.follow_renames = 1;
        else if (!strcmp(arg, "--no-follow")) {