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

[PATCH] submodule: remove redundant check for the_index.initialized

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Jun 9, 2013, 16:33 UTC
Message-ID
<1370795625-10506-1-git-send-email-rene.scharfe@lsrfire.ath.cx>

read_cache already performs the same check and returns immediately if the cache has already been loaded.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 submodule.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/submodule.c b/submodule.c
index e728025..1821a5b 100644
--- a/submodule.c
+++ b/submodule.c
@@ -603,9 +603,8 @@ int fetch_populated_submodules(const struct argv_array *options,
 	if (!work_tree)
 		goto out;
 
-	if (!the_index.initialized)
-		if (read_cache() < 0)
-			die("index file corrupt");
+	if (read_cache() < 0)
+		die("index file corrupt");
 
 	argv_array_push(&argv, "fetch");
 	for (i = 0; i < options->argc; i++)
-- 
1.8.3
Next: Felipe Contreras
Message 1 of 3 in “submodule: remove redundant check for the_index.initialized”
  1. submodule: remove redundant check for the_index.initializedRené Scharfe, Jun 9, 2013
  2. Felipe ContrerasJun 9, 2013
  3. René ScharfeJun 9, 2013

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.