| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -491,14 +491,6 @@ | |||
| 491 | 491 | "lineCount": 1 | |
| 492 | 492 | } | |
| 493 | 493 | }, | |
| 494 | - { | ||
| 495 | - "code": "reportPossiblyUnboundVariable", | ||
| 496 | - "range": { | ||
| 497 | - "startColumn": 15, | ||
| 498 | - "endColumn": 20, | ||
| 499 | - "lineCount": 1 | ||
| 500 | - } | ||
| 501 | - }, | ||
| 502 | 494 | { | |
| 503 | 495 | "code": "reportArgumentType", | |
| 504 | 496 | "range": { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -316,8 +316,9 @@ def _validated_name(cls, name: str) -> str: | |||
| 316 | 316 | ||
| 317 | 317 | @classmethod | |
| 318 | 318 | def _module_abspath(cls, parent_repo: "Repo", path: PathLike, name: str) -> PathLike: | |
| 319 | + name = cls._validated_name(name) | ||
| 319 | 320 | if cls._need_gitfile_submodules(parent_repo.git): | |
| 320 | - return osp.join(parent_repo.git_dir, "modules", cls._validated_name(name)) | ||
| 321 | + return osp.join(parent_repo.git_dir, "modules", name) | ||
| 321 | 322 | if parent_repo.working_tree_dir: | |
| 322 | 323 | return osp.join(parent_repo.working_tree_dir, path) | |
| 323 | 324 | raise NotADirectoryError() | |
@@ -747,9 +748,7 @@ def update( | |||
| 747 | 748 | prefix = "DRY-RUN: " | |
| 748 | 749 | # END handle prefix | |
| 749 | 750 | ||
| 750 | - # To keep things plausible in dry-run mode. | ||
| 751 | - if dry_run: | ||
| 752 | - mrepo = None | ||
| 751 | + mrepo = None | ||
| 753 | 752 | # END init mrepo | |
| 754 | 753 | ||
| 755 | 754 | def fetch_remotes(module_repo: "Repo") -> None: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -971,6 +971,10 @@ def test_update_rejects_parent_component_in_name(self, rwdir): | |||
| 971 | 971 | with pytest.raises(ValueError, match="submodule name"): | |
| 972 | 972 | Submodule._module_abspath(clone, "module", name) | |
| 973 | 973 | ||
| 974 | + with mock.patch.object(Submodule, "_need_gitfile_submodules", return_value=False): | ||
| 975 | + with pytest.raises(ValueError, match="submodule name"): | ||
| 976 | + Submodule._module_abspath(clone, "module", "../module") | ||
| 977 | + | ||
| 974 | 978 | @with_rw_directory | |
| 975 | 979 | @_patch_git_config("protocol.file.allow", "always") | |
| 976 | 980 | def test_root_update_keeps_going_after_invalid_submodule_name(self, rwdir): | |
@@ -994,6 +998,8 @@ def test_root_update_keeps_going_after_invalid_submodule_name(self, rwdir): | |||
| 994 | 998 | assert not clone.submodule("../invalid").module_exists() | |
| 995 | 999 | assert clone.submodule("valid").module_exists() | |
| 996 | 1000 | ||
| 1001 | + clone.submodule("../invalid").update(recursive=True, keep_going=True) | ||
| 1002 | + | ||
| 997 | 1003 | @with_rw_directory | |
| 998 | 1004 | @_patch_git_config("protocol.file.allow", "always") | |
| 999 | 1005 | def test_list_only_valid_submodules(self, rwdir): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments