Re: [PATCH 1/2] submodule--helper: remove an unreachable call to usage_with_options

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

 



On Mon, Jun 21, 2021 at 3:09 PM Kaartic Sivaraam
<kaartic.sivaraam@xxxxxxxxx> wrote:
> The code path in question calls `error` in a particular case.
> But, `error` never returns as it exits directly. This makes
> the call to `usage_with_options` that follows the `error` call
> unreachable.

error() returns -1; you will commonly see:

    if (check_something())
        return error(...);

> So, remove the unreachable `usage_with_options` call.
>
> Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@xxxxxxxxx>
> ---
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> @@ -1637,8 +1637,6 @@ static int module_deinit(int argc, const char **argv, const char *prefix)
>         if (all && argc) {
>                 error("pathspec and --all are incompatible");
> -               usage_with_options(git_submodule_helper_usage,
> -                                  module_deinit_options);
>         }

usage_with_options(), on the other hand, exits directly.



[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