diff options
author | Yaroslav Halchenko <debian@onerussian.com> | 2016-10-02 10:27:53 -0400 |
---|---|---|
committer | Yaroslav Halchenko <debian@onerussian.com> | 2016-10-02 10:27:53 -0400 |
commit | f284a4e7c8861381b0139b76af4d5f970edb7400 (patch) | |
tree | 4b115ed9c141ee8a94b27063419d46ed0a8f895d /git/test/test_submodule.py | |
parent | 2528d11844a856838c0519e86fe08adc3feb5df1 (diff) | |
download | gitpython-f284a4e7c8861381b0139b76af4d5f970edb7400.tar.gz |
TST: finishing test for removing submodule with remotes without refs
originally draft committed by mistake in 31fd955dfcc8176fd65f92fa859374387d3e0095
sorry
Diffstat (limited to 'git/test/test_submodule.py')
-rw-r--r-- | git/test/test_submodule.py | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index eae6ab9f..6dcf1831 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -806,25 +806,18 @@ class TestSubmodule(TestBase): 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!! + # so created a new instance for submodule + smrepo = git.Repo(os.path.join(rwdir, 'parent', sm.path)) # Adding a remote without fetching so would have no references - sm.repo.create_remote('special', 'git@server-shouldnotmatter:repo.git') - assert sm.rename(sm_name) is sm and sm.name == sm_name - assert not sm.repo.is_dirty(index=True, working_tree=False, untracked_files=False) - - new_path = 'renamed/myname' - assert sm.move(new_path).name == new_path - - new_sm_name = "shortname" - assert sm.rename(new_sm_name) is sm - assert sm.repo.is_dirty(index=True, working_tree=False, untracked_files=False) - assert sm.exists() - - sm_mod = sm.module() - if os.path.isfile(os.path.join(sm_mod.working_tree_dir, '.git')) == sm._need_gitfile_submodules(parent.git): - assert sm_mod.git_dir.endswith(join_path_native('.git', 'modules', new_sm_name)) - # end + smrepo.create_remote('special', 'git@server-shouldnotmatter:repo.git') + # And we should be able to remove it just fine + sm.remove() + assert not sm.exists() @with_rw_directory def test_rename(self, rwdir): |