File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ def _clone_submodules(cls, repo: Repo) -> None:
333
333
modules_config = repo_root .joinpath (".gitmodules" )
334
334
335
335
# A relative URL by definition starts with ../ or ./
336
- relative_submodule_regex = re .compile ("^(\\ . \\ ./| \\ ./), ?" )
336
+ relative_submodule_regex = re .compile (r "^(\.{1,2})/ ?" )
337
337
338
338
if modules_config .exists ():
339
339
config = ConfigFile .from_path (str (modules_config ))
@@ -347,12 +347,8 @@ def _clone_submodules(cls, repo: Repo) -> None:
347
347
path_absolute = repo_root .joinpath (path_relative )
348
348
349
349
url_string = url .decode ("utf-8" )
350
- final_url = url_string
351
- submodule_is_relative = bool (
352
- relative_submodule_regex .search (url_string )
353
- )
354
- if submodule_is_relative :
355
- final_url = urljoin (f"{ Git .get_remote_url (repo )} /" , url_string )
350
+ if relative_submodule_regex .search (url_string ):
351
+ url_string = urljoin (f"{ Git .get_remote_url (repo )} /" , url_string )
356
352
357
353
source_root = path_absolute .parent
358
354
source_root .mkdir (parents = True , exist_ok = True )
@@ -370,7 +366,7 @@ def _clone_submodules(cls, repo: Repo) -> None:
370
366
continue
371
367
372
368
cls .clone (
373
- url = final_url ,
369
+ url = url_string ,
374
370
source_root = source_root ,
375
371
name = path_relative .name ,
376
372
revision = revision ,
You can’t perform that action at this time.
0 commit comments