diff: use skip_to_optional_arg_default() in parsing --relative
Helped-by: Jacob Keller <jacob.keller@gmail.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
cf81f94da4
commit
1efad51197
5
diff.c
5
diff.c
@ -4563,10 +4563,9 @@ int diff_opt_parse(struct diff_options *options,
|
||||
options->flags.rename_empty = 1;
|
||||
else if (!strcmp(arg, "--no-rename-empty"))
|
||||
options->flags.rename_empty = 0;
|
||||
else if (!strcmp(arg, "--relative"))
|
||||
options->flags.relative_name = 1;
|
||||
else if (skip_prefix(arg, "--relative=", &arg)) {
|
||||
else if (skip_to_optional_arg_default(arg, "--relative", &arg, NULL)) {
|
||||
options->flags.relative_name = 1;
|
||||
if (arg)
|
||||
options->prefix = arg;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user