| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b532a50 commit 69c5c61
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,7 +151,7 @@ def find_submodule_git_dir(d: PathLike) -> Optional[PathLike]: | |||
| 151 | 151 | # Cygwin creates submodules prefixed with `/cygdrive/...`. | |
| 152 | 152 | # Cygwin git understands Cygwin paths much better than Windows ones. | |
| 153 | 153 | # Also the Cygwin tests are assuming Cygwin paths. | |
| 154 | - path = cygpath(path) | ||
| 154 | + path = cygpath(path, expand_vars=False) | ||
| 155 | 155 | if not osp.isabs(path): | |
| 156 | 156 | path = osp.normpath(osp.join(osp.dirname(d), path)) | |
| 157 | 157 | return path if is_git_dir(path) else None | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,6 +70,11 @@ def test_submodule_update_preserves_literal_name(tmp_path, monkeypatch, caplog, | |||
| 70 | 70 | ||
| 71 | 71 | modules_dir = Path(clone.git_dir, "modules") | |
| 72 | 72 | assert {path.name for path in modules_dir.iterdir()} == {name} | |
| 73 | + # Exercise relative gitfile conversion on every platform. | ||
| 74 | + with mock.patch.object(Git, "is_cygwin", return_value=True): | ||
| 75 | + resolved_git_dir = find_submodule_git_dir(Path(clone.working_tree_dir, "module", ".git")) | ||
| 76 | + assert resolved_git_dir is not None | ||
| 77 | + assert (modules_dir / name).samefile(resolved_git_dir) | ||
| 73 | 78 | with clone.submodules[0].module() as module: | |
| 74 | 79 | assert (modules_dir / name).samefile(module.git_dir) | |
| 75 | 80 | assert module.head.commit == source.head.commit | |
| Back | FazBrowse Home | New Git URL |
0 commit comments