Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-02-21 14:16:18 +0300
committerJunio C Hamano <gitster@pobox.com>2019-02-22 02:16:59 +0300
commitcdc43eb0b871992b42cff02ea9fe818c812c6dca (patch)
tree78acc95febc78027caa0e67f7e312423b7da0a6c /diff.c
parentbdd4741bfd380ca70fe3d185e7bd7f8ff54eafc1 (diff)
diff-parseopt: convert --no-renames|--[no--rename-empty
For --rename-empty, see 90d43b0768 (teach diffcore-rename to optionally ignore empty content - 2012-03-22) for more information. 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.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/diff.c b/diff.c
index abb1566f95..d423a06b41 100644
--- a/diff.c
+++ b/diff.c
@@ -5087,6 +5087,11 @@ static void prep_parse_options(struct diff_options *options)
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_SET_INT_F(0, "no-renames", &options->detect_rename,
+ N_("disable rename detection"),
+ 0, PARSE_OPT_NONEG),
+ OPT_BOOL(0, "rename-empty", &options->flags.rename_empty,
+ N_("use empty blobs as rename source")),
OPT_GROUP(N_("Diff other options")),
{ OPTION_CALLBACK, 0, "output", options, N_("<file>"),
@@ -5121,13 +5126,7 @@ int diff_opt_parse(struct diff_options *options,
return ac;
/* renames options */
- if (!strcmp(arg, "--no-renames"))
- options->detect_rename = 0;
- else if (!strcmp(arg, "--rename-empty"))
- options->flags.rename_empty = 1;
- else if (!strcmp(arg, "--no-rename-empty"))
- options->flags.rename_empty = 0;
- else if (skip_to_optional_arg_default(arg, "--relative", &arg, NULL)) {
+ if (skip_to_optional_arg_default(arg, "--relative", &arg, NULL)) {
options->flags.relative_name = 1;
if (arg)
options->prefix = arg;