Commit 60c2bf47e40d86f1fcf9b9b928666ed2b06d0e4d

Edward Thomson 2017-01-22T00:58:41

submodule: only examine idx & head given a config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/submodule.c b/src/submodule.c
index 9e007df..fc3dcb4 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -512,12 +512,12 @@ int git_submodule__map(git_repository *repo, git_strmap *map)
 			goto cleanup;
 	}
 	/* add back submodule information from index */
-	if (idx) {
+	if (mods && idx) {
 		if ((error = submodules_from_index(map, idx, mods)) < 0)
 			goto cleanup;
 	}
 	/* add submodule information from HEAD */
-	if (head) {
+	if (mods && head) {
 		if ((error = submodules_from_head(map, head, mods)) < 0)
 			goto cleanup;
 	}