◐ Shell
clean mode source ↗

Added test for PR #1645 submodule path by CosmosAtlas · Pull Request #1647 · gitpython-developers/GitPython

Expand Up @@ -906,6 +906,28 @@ def assert_exists(sm, value=True): assert osp.isdir(sm_module_path) == dry_run # end for each dry-run mode
@with_rw_directory def test_ignore_non_submodule_file(self, rwdir): parent = git.Repo.init(rwdir)
smp = osp.join(rwdir, "module") os.mkdir(smp)
with open(osp.join(smp, "a"), "w", encoding="utf-8") as f: f.write('test\n')
with open(osp.join(rwdir, ".gitmodules"), "w", encoding="utf-8") as f: f.write("[submodule \"a\"]\n") f.write(" path = module\n") f.write(" url = https://github.com/chaconinc/DbConnector\n")
parent.git.add(Git.polish_url(osp.join(smp, "a"))) parent.git.add(Git.polish_url(osp.join(rwdir, ".gitmodules")))
parent.git.commit(message='test')
assert len(parent.submodules) == 0
@with_rw_directory def test_remove_norefs(self, rwdir): parent = git.Repo.init(osp.join(rwdir, "parent")) Expand Down