BF: remove a submodule with a remote without refs + misc fixes around by yarikoptic · Pull Request #521 · gitpython-developers/GitPython
@with_rw_directory def test_remove_norefs(self, rwdir): parent = git.Repo.init(os.path.join(rwdir, 'parent')) sm_name = 'mymodules/myname' sm = parent.create_submodule(sm_name, sm_name, url=self._small_repo_url()) assert sm.exists()
parent.index.commit("Added submodule")
assert sm.repo is parent # yoh was surprised since expected sm repo!!
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and I am not sure why that is the case -- I was expecting submodules repo to be the repo of the submodule ... but I guess it can make sense to refer to parent which contains the submodule, but then is there an attribute for submodules repo (if present)?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Byron any comment? I'm not familiar with git-modules.
@with_rw_directory def test_rename(self, rwdir): parent = git.Repo.init(os.path.join(rwdir, 'parent'))