threads / patch / 34074

patchsubmodule: remove redundant check for the_index.initialized

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

## tl;dr

3 messages between Jun 9, 2013 and Jun 9, 2013. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

René Scharfe· Jun 9, 2013, 16:33 UTC · lore

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(-)
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
Felipe Contreras· Jun 9, 2013, 16:44 UTC · re: René Scharfe · lore

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

On Sun, Jun 9, 2013 at 11:33 AM, René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:

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

This time I beat you to it first ;) http://article.gmane.org/gmane.comp.version-control.git/226701

-- 
Felipe Contreras
René Scharfe· Jun 9, 2013, 17:41 UTC · re: Felipe Contreras · lore

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

Am 09.06.2013 18:44, schrieb Felipe Contreras:
Show 7 quoted lines
> On Sun, Jun 9, 2013 at 11:33 AM, René Scharfe
> <rene.scharfe@lsrfire.ath.cx> wrote:
>> read_cache already performs the same check and returns immediately if
>> the cache has already been loaded.
>
> This time I beat you to it first ;)
> http://article.gmane.org/gmane.comp.version-control.git/226701
Good to see we're agreeing on something for once. ;)
René

← back to recent threads