Skip to content

Commit c659f30

Browse files
pcloudsgitster
authored andcommitted
diff-parseopt: convert --patch-with-raw
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ed88148 commit c659f30

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

diff.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4901,6 +4901,10 @@ static void prep_parse_options(struct diff_options *options)
49014901
OPT_BIT_F(0, "raw", &options->output_format,
49024902
N_("generate the diff in raw format"),
49034903
DIFF_FORMAT_RAW, PARSE_OPT_NONEG),
4904+
OPT_BITOP(0, "patch-with-raw", &options->output_format,
4905+
N_("synonym for '-p --raw'"),
4906+
DIFF_FORMAT_PATCH | DIFF_FORMAT_RAW,
4907+
DIFF_FORMAT_NO_OUTPUT),
49044908
OPT_END()
49054909
};
49064910

@@ -4929,10 +4933,7 @@ int diff_opt_parse(struct diff_options *options,
49294933
return ac;
49304934

49314935
/* Output format options */
4932-
if (!strcmp(arg, "--patch-with-raw")) {
4933-
enable_patch_output(&options->output_format);
4934-
options->output_format |= DIFF_FORMAT_RAW;
4935-
} else if (!strcmp(arg, "--numstat"))
4936+
if (!strcmp(arg, "--numstat"))
49364937
options->output_format |= DIFF_FORMAT_NUMSTAT;
49374938
else if (!strcmp(arg, "--shortstat"))
49384939
options->output_format |= DIFF_FORMAT_SHORTSTAT;

0 commit comments

Comments
 (0)