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-01-27 03:35:34 +0300
committerJunio C Hamano <gitster@pobox.com>2019-01-28 03:28:18 +0300
commit7fd9a1ba039b683f596d10bacbf892fa5e8f202f (patch)
tree12e72262c4da2423a6f2a362f22de3c817d293d6 /diff.c
parentd473e2e0e8eedf2ab07ddc545e00bff7c8f450e7 (diff)
diff.c: convert -W|--[no-]function-context
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.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/diff.c b/diff.c
index 093158244e..8f70101362 100644
--- a/diff.c
+++ b/diff.c
@@ -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()
};
@@ -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");