diff.c: convert --raw

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Jan 27, 2019 at 07:35 UTC ed88148674502893790bf13d70154c157a489a6b
1 file changed +4 -3
diff.c
+4 -3
@@ -4898,6 +4898,9 @@ static void prep_parse_options(struct diff_options *options)
4898 PARSE_OPT_NONEG, diff_opt_unified),
4899 OPT_BOOL('W', "function-context", &options->flags.funccontext,
4900 N_("generate diffs with <n> lines context")),
4901 + OPT_BIT_F(0, "raw", &options->output_format,
4902 + N_("generate the diff in raw format"),
4903 + DIFF_FORMAT_RAW, PARSE_OPT_NONEG),
4904 OPT_END()
4905 };
4906
@@ -4926,9 +4929,7 @@ int diff_opt_parse(struct diff_options *options,
4929 return ac;
4930
4931 /* Output format options */
4929 - if (!strcmp(arg, "--raw"))
4930 - options->output_format |= DIFF_FORMAT_RAW;
4931 - else if (!strcmp(arg, "--patch-with-raw")) {
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"))