git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Atharva Raykar <raykar.ath@gmail.com>,
	Shourya Shukla <shouryashukla.oo@gmail.com>
Subject: [PATCH 1/2] submodule--helper: remove an unreachable call to usage_with_options
Date: Tue, 22 Jun 2021 00:38:36 +0530	[thread overview]
Message-ID: <20210621190837.9487-2-kaartic.sivaraam@gmail.com> (raw)
In-Reply-To: <20210621190837.9487-1-kaartic.sivaraam@gmail.com>

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.

So, remove the unreachable `usage_with_options` call.

Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
---
 builtin/submodule--helper.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index ae6174ab05..c9aa838083 100644
--- 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);
 	}
 
 	if (!argc && !all)
-- 
2.32.0.9.g81a5432dce.dirty


  reply	other threads:[~2021-06-21 19:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 19:08 [PATCH 0/2] Some submodule related code cleanup Kaartic Sivaraam
2021-06-21 19:08 ` Kaartic Sivaraam [this message]
2021-06-21 19:58   ` [PATCH 1/2] submodule--helper: remove an unreachable call to usage_with_options Eric Sunshine
2021-06-22 18:02     ` Kaartic Sivaraam
2021-06-21 19:08 ` [PATCH 2/2] submodule: remove unnecessary `prefix` based option logic Kaartic Sivaraam
2021-06-22 18:14 ` [PATCH v2 0/1] Some submodule related code cleanup Kaartic Sivaraam
2021-06-22 18:14   ` [PATCH v2 1/1] submodule: remove unnecessary `prefix` based option logic Kaartic Sivaraam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210621190837.9487-2-kaartic.sivaraam@gmail.com \
    --to=kaartic.sivaraam@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=raykar.ath@gmail.com \
    --cc=shouryashukla.oo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).