1010def list_project_submodules (
1111 project : Project ,
1212 ref : Optional [str ] = None ) -> List [Submodule ]:
13- return list (_get_project_submodules (project , ref ))
13+ return list (iterate_project_submodules (project , ref ))
1414
1515
16- def _get_project_submodules (
16+ def iterate_project_submodules (
1717 project : Project ,
1818 ref : Optional [str ] = None ) -> Iterable [Submodule ]:
1919 gitmodules_file_content = _get_gitmodules_file_content (project , ref )
@@ -41,7 +41,7 @@ def _get_gitmodules_file_content(project: Project,
4141
4242
4343def _read_gitmodules_file_content (
44- gitmodules_file_content : str ) -> List [Tuple [str , str , str ]]:
44+ gitmodules_file_content : str ) -> Iterable [Tuple [str , str , str ]]:
4545 """Some basic regex extractions to parse content of .gitmodules file
4646 """
4747 name_regex = r'\[submodule "([a-zA-Z0-9\.\-/_]+)"\]'
@@ -52,4 +52,4 @@ def _read_gitmodules_file_content(
5252 urls = re .findall (url_regex , gitmodules_file_content )
5353 if not (len (names ) == len (paths ) == len (urls )):
5454 raise RuntimeError ('Failed parsing the .gitmodules content' )
55- return list ( zip (names , urls , paths ) )
55+ return zip (names , urls , paths )
0 commit comments