Commit e48dd86ecae27dcf688ad4e4c9f786fd420a18b8

Carlos Martín Nieto 2015-07-11T18:31:28

submodule: lookup the submodule by path if available If we get the path from the gitmodules file, look up the submodule we're interested in by path, rather then by name. Otherwise we might get duplicate results.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/submodule.c b/src/submodule.c
index fb3d4bf..892c983 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -1647,7 +1647,7 @@ static int submodule_load_from_config(
 	} else {
 		khiter_t pos;
 		git_strmap *map = data->map;
-		pos = git_strmap_lookup_index(map, name.ptr);
+		pos = git_strmap_lookup_index(map, path ? path : name.ptr);
 		if (git_strmap_valid_index(map, pos)) {
 			sm = git_strmap_value_at(map, pos);
 		} else {