git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Date
Jun 21, 2021, 19:08 UTC
Message-ID
<20210621190837.9487-2-kaartic.sivaraam@gmail.com>
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
Previous: Kaartic SivaraamNext: Eric Sunshine
Message 2 of 7 in “Some submodule related code cleanup”
  1. 0/2 Some submodule related code cleanupKaartic Sivaraam, Jun 21, 2021
  2. 1/2 submodule--helper: remove an unreachable call to usage_with_optionsKaartic Sivaraam, Jun 21, 2021
  3. Eric SunshineJun 21, 2021
  4. Kaartic SivaraamJun 22, 2021
  5. 2/2 submodule: remove unnecessary `prefix` based option logicKaartic Sivaraam, Jun 21, 2021
  6. 0/1 Some submodule related code cleanupKaartic Sivaraam, Jun 22, 2021
  7. 1/1 submodule: remove unnecessary `prefix` based option logicKaartic Sivaraam, Jun 22, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.