X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=diff.c;h=a654d46f6a93de96d85706c7373ef0d617081a21;hb=fb9d7431cf4c4d4d90ad2d2904c7feb19dfb2f8f;hp=4d3cf83a27e5785f5fd50dd2ce6155c94eb50840;hpb=c42986f41caf673aa5536df8cae980969a063f3f;p=thirdparty%2Fgit.git diff --git a/diff.c b/diff.c index 4d3cf83a27..a654d46f6a 100644 --- a/diff.c +++ b/diff.c @@ -5211,9 +5211,11 @@ static int diff_opt_unified(const struct option *opt, BUG_ON_OPT_NEG(unset); - options->context = strtol(arg, &s, 10); - if (*s) - return error(_("%s expects a numerical value"), "--unified"); + if (arg) { + options->context = strtol(arg, &s, 10); + if (*s) + return error(_("%s expects a numerical value"), "--unified"); + } enable_patch_output(&options->output_format); return 0; @@ -5272,7 +5274,7 @@ static void prep_parse_options(struct diff_options *options) DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT), OPT_CALLBACK_F('U', "unified", options, N_(""), N_("generate diffs with lines context"), - PARSE_OPT_NONEG, diff_opt_unified), + PARSE_OPT_NONEG | PARSE_OPT_OPTARG, diff_opt_unified), OPT_BOOL('W', "function-context", &options->flags.funccontext, N_("generate diffs with lines context")), OPT_BIT_F(0, "raw", &options->output_format, @@ -5352,7 +5354,7 @@ static void prep_parse_options(struct diff_options *options) N_("show the given source prefix instead of \"a/\""), PARSE_OPT_NONEG), OPT_STRING_F(0, "dst-prefix", &options->b_prefix, N_(""), - N_("show the given source prefix instead of \"b/\""), + N_("show the given destination prefix instead of \"b/\""), PARSE_OPT_NONEG), OPT_CALLBACK_F(0, "line-prefix", options, N_(""), N_("prepend an additional prefix to every line of output"), @@ -5453,13 +5455,13 @@ static void prep_parse_options(struct diff_options *options) N_("equivalent to --word-diff=color --word-diff-regex="), PARSE_OPT_NONEG | PARSE_OPT_OPTARG, diff_opt_color_words), OPT_CALLBACK_F(0, "color-moved", options, N_(""), - N_("move lines of code are colored differently"), + N_("moved lines of code are colored differently"), PARSE_OPT_OPTARG, diff_opt_color_moved), OPT_CALLBACK_F(0, "color-moved-ws", options, N_(""), N_("how white spaces are ignored in --color-moved"), 0, diff_opt_color_moved_ws), - OPT_GROUP(N_("Diff other options")), + OPT_GROUP(N_("Other diff options")), OPT_CALLBACK_F(0, "relative", options, N_(""), N_("when run from subdir, exclude changes outside and show relative paths"), PARSE_OPT_NONEG | PARSE_OPT_OPTARG,