diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-02-21 14:16:15 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-22 02:16:59 +0300 |
commit | 1e5332968a0f46978d457ec580bb1c00c48fd13c (patch) | |
tree | 2cee34bc78a55dc616f792cfb0e3dabe5af96abd /diff.c | |
parent | f476308b273bdc78f9a8921b2bafffd39ea1e00e (diff) |
diff-parseopt: convert -D|--irreversible-delete
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -5060,6 +5060,9 @@ static void prep_parse_options(struct diff_options *options) N_("detect renames"), PARSE_OPT_NONEG | PARSE_OPT_OPTARG, diff_opt_find_renames), + OPT_SET_INT_F('D', "irreversible-delete", &options->irreversible_delete, + N_("omit the preimage for deletes"), + 1, PARSE_OPT_NONEG), OPT_GROUP(N_("Diff other options")), { OPTION_CALLBACK, 0, "output", options, N_("<file>"), @@ -5094,10 +5097,7 @@ int diff_opt_parse(struct diff_options *options, return ac; /* renames options */ - if (!strcmp(arg, "-D") || !strcmp(arg, "--irreversible-delete")) { - options->irreversible_delete = 1; - } - else if (starts_with(arg, "-C") || + if (starts_with(arg, "-C") || skip_to_optional_arg(arg, "--find-copies", NULL)) { if (options->detect_rename == DIFF_DETECT_COPY) options->flags.find_copies_harder = 1; |