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:09 +0300
committerJunio C Hamano <gitster@pobox.com>2019-02-22 02:16:59 +0300
commite01df7a33d368e2bd2ce7b72b007bc18c51875d8 (patch)
treebeabfc243df690940f9771491cc5bf2354b5a393 /diff.c
parenta23874726b077c8ebb19a32855665bce04875b75 (diff)
diff-parseopt: convert -s|--no-patch
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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/diff.c b/diff.c
index 99047fb5fe..9c8f5336bc 100644
--- a/diff.c
+++ b/diff.c
@@ -4906,6 +4906,9 @@ static void prep_parse_options(struct diff_options *options)
OPT_BITOP('p', "patch", &options->output_format,
N_("generate patch"),
DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT),
+ OPT_BIT_F('s', "no-patch", &options->output_format,
+ N_("suppress diff output"),
+ DIFF_FORMAT_NO_OUTPUT, PARSE_OPT_NONEG),
OPT_BITOP('u', NULL, &options->output_format,
N_("generate patch"),
DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT),
@@ -4983,9 +4986,7 @@ int diff_opt_parse(struct diff_options *options,
return ac;
/* Output format options */
- if (!strcmp(arg, "-s") || !strcmp(arg, "--no-patch"))
- options->output_format |= DIFF_FORMAT_NO_OUTPUT;
- else if (starts_with(arg, "--stat"))
+ if (starts_with(arg, "--stat"))
/* --stat, --stat-width, --stat-name-width, or --stat-count */
return stat_opt(options, av);
else if (!strcmp(arg, "--compact-summary")) {