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.
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 {