diff-parseopt: convert -z
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
Mar 24, 2019 at 15:19 UTC
1a1eb164cfec50ab9869cd3e61f2415ae9e2f599
1 file changed
+3
-2
diff.c
+3
-2
@@ -5238,6 +5238,9 @@ static void prep_parse_options(struct diff_options *options)
5238
OPT_CALLBACK_F(0, "ws-error-highlight", options, N_("<kind>"),
5239
N_("highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff"),
5240
PARSE_OPT_NONEG, diff_opt_ws_error_highlight),
5241
+ OPT_SET_INT('z', NULL, &options->line_termination,
5242
+ N_("do not munge pathnames and use NULs as output field terminators in --raw or --numstat"),
5243
+ 0),
5244
OPT_CALLBACK_F(0, "output-indicator-new",
5245
&options->output_indicators[OUTPUT_INDICATOR_NEW],
5246
N_("<char>"),
@@ -5410,8 +5413,6 @@ int diff_opt_parse(struct diff_options *options,
5413
}
5414
5415
/* misc options */
5413
- else if (!strcmp(arg, "-z"))
5414
- options->line_termination = 0;
5416
else if ((argcount = short_opt('l', av, &optarg))) {
5417
options->rename_limit = strtoul(optarg, NULL, 10);
5418
return argcount;