Skip to content

Commit

Permalink
diff.c: convert -W|--[no-]function-context
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
pclouds authored and gitster committed Jan 28, 2019
1 parent d473e2e commit 7fd9a1b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -4896,6 +4896,8 @@ static void prep_parse_options(struct diff_options *options)
OPT_CALLBACK_F('U', "unified", options, N_("<n>"),
N_("generate diffs with <n> lines context"),
PARSE_OPT_NONEG, diff_opt_unified),
OPT_BOOL('W', "function-context", &options->flags.funccontext,
N_("generate diffs with <n> lines context")),
OPT_END()
};

Expand Down Expand Up @@ -5212,12 +5214,6 @@ int diff_opt_parse(struct diff_options *options,
else if (opt_arg(arg, '\0', "inter-hunk-context",
&options->interhunkcontext))
;
else if (!strcmp(arg, "-W"))
options->flags.funccontext = 1;
else if (!strcmp(arg, "--function-context"))
options->flags.funccontext = 1;
else if (!strcmp(arg, "--no-function-context"))
options->flags.funccontext = 0;
else if ((argcount = parse_long_opt("output", av, &optarg))) {
char *path = prefix_filename(prefix, optarg);
options->file = xfopen(path, "w");
Expand Down

0 comments on commit 7fd9a1b

Please sign in to comment.