@@ -806,25 +806,18 @@ def test_remove_norefs(self, rwdir):
806
806
parent = git .Repo .init (os .path .join (rwdir , 'parent' ))
807
807
sm_name = 'mymodules/myname'
808
808
sm = parent .create_submodule (sm_name , sm_name , url = self ._small_repo_url ())
809
+ assert sm .exists ()
810
+
809
811
parent .index .commit ("Added submodule" )
810
812
813
+ assert sm .repo is parent # yoh was surprised since expected sm repo!!
814
+ # so created a new instance for submodule
815
+ smrepo = git .Repo (os .path .join (rwdir , 'parent' , sm .path ))
811
816
# Adding a remote without fetching so would have no references
812
- sm .repo .create_remote ('special' , 'git@server-shouldnotmatter:repo.git' )
813
- assert sm .rename (sm_name ) is sm and sm .name == sm_name
814
- assert not sm .repo .is_dirty (index = True , working_tree = False , untracked_files = False )
815
-
816
- new_path = 'renamed/myname'
817
- assert sm .move (new_path ).name == new_path
818
-
819
- new_sm_name = "shortname"
820
- assert sm .rename (new_sm_name ) is sm
821
- assert sm .repo .is_dirty (index = True , working_tree = False , untracked_files = False )
822
- assert sm .exists ()
823
-
824
- sm_mod = sm .module ()
825
- if os .path .isfile (os .path .join (sm_mod .working_tree_dir , '.git' )) == sm ._need_gitfile_submodules (parent .git ):
826
- assert sm_mod .git_dir .endswith (join_path_native ('.git' , 'modules' , new_sm_name ))
827
- # end
817
+ smrepo .create_remote ('special' , 'git@server-shouldnotmatter:repo.git' )
818
+ # And we should be able to remove it just fine
819
+ sm .remove ()
820
+ assert not sm .exists ()
828
821
829
822
@with_rw_directory
830
823
def test_rename (self , rwdir ):
0 commit comments