diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-12-09 21:40:11 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-11 16:10:12 -0800 |
commit | 1efad51197f52ba9fb928b92a7f92514ab02a97f (patch) | |
tree | 90b6ec4cc5234a416b1b06aba06a3ef3c4dece24 | |
parent | diff: use skip_to_optional_arg_default() (diff) | |
download | tgif-1efad51197f52ba9fb928b92a7f92514ab02a97f.tar.xz |
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>
-rw-r--r-- | diff.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -4563,11 +4563,10 @@ 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")) + else if (skip_to_optional_arg_default(arg, "--relative", &arg, NULL)) { options->flags.relative_name = 1; - else if (skip_prefix(arg, "--relative=", &arg)) { - options->flags.relative_name = 1; - options->prefix = arg; + if (arg) + options->prefix = arg; } /* xdiff options */ |