threads / patch / 34000

patchsubmodule: remove unnecessary check

Subject: [PATCH] submodule: remove unnecessary check

## tl;dr

One message between May 31, 2013 and May 31, 2013. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Felipe Contreras· May 31, 2013, 08:27 UTC · lore
read_cache() already does that check.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 submodule.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Show changes to submodule.c +2 −3
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.358.g5a91d05

← back to recent threads