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-03-24 11:19:56 +0300
committerJunio C Hamano <gitster@pobox.com>2019-03-24 16:21:21 +0300
commit96860e48d3b7da2f20f4b7e8668246335d0527b9 (patch)
tree53328f10e6857ad0deb7c3062b7345e7d91312a9 /diff.c
parent5a749d9f97c680c7379cadda474396e7c4301254 (diff)
diff-parseopt: convert --ita-[in]visible-in-index
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.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/diff.c b/diff.c
index 7bfdf08137..8255db6966 100644
--- a/diff.c
+++ b/diff.c
@@ -5352,6 +5352,12 @@ static void prep_parse_options(struct diff_options *options)
N_("specify how differences in submodules are shown"),
PARSE_OPT_NONEG | PARSE_OPT_OPTARG,
diff_opt_submodule),
+ OPT_SET_INT_F(0, "ita-invisible-in-index", &options->ita_invisible_in_index,
+ N_("hide 'git add -N' entries from the index"),
+ 1, PARSE_OPT_NONEG),
+ OPT_SET_INT_F(0, "ita-visible-in-index", &options->ita_invisible_in_index,
+ N_("treat 'git add -N' entries as real in the index"),
+ 0, PARSE_OPT_NONEG),
{ OPTION_CALLBACK, 0, "output", options, N_("<file>"),
N_("Output to a specific file"),
PARSE_OPT_NONEG, NULL, 0, diff_opt_output },
@@ -5401,10 +5407,7 @@ int diff_opt_parse(struct diff_options *options,
if (cm & COLOR_MOVED_WS_ERROR)
return -1;
options->color_moved_ws_handling = cm;
- } else if (!strcmp(arg, "--ita-invisible-in-index"))
- options->ita_invisible_in_index = 1;
- else if (!strcmp(arg, "--ita-visible-in-index"))
- options->ita_invisible_in_index = 0;
+ }
/* misc options */
else if (!strcmp(arg, "-z"))