Re: [PATCH v2 5/7] diff: use skip-to-optional-val in parsing --relative

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 7, 2017 at 9:30 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
> ---
>  diff.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/diff.c b/diff.c
> index cd032c6367..e99ac6ec8a 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -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_val_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 */
> --
> 2.15.1-480-gbc5668f98a
>

Yea, this is exactly what I had imagined as the fix.

Thanks,
Jake



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux