Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf284a4e

Browse files
committed
TST: finishing test for removing submodule with remotes without refs
originally draft committed by mistake in31fd955sorry
1 parent2528d11 commitf284a4e

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

‎git/test/test_submodule.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -806,25 +806,18 @@ def test_remove_norefs(self, rwdir):
806806
parent=git.Repo.init(os.path.join(rwdir,'parent'))
807807
sm_name='mymodules/myname'
808808
sm=parent.create_submodule(sm_name,sm_name,url=self._small_repo_url())
809+
assertsm.exists()
810+
809811
parent.index.commit("Added submodule")
810812

813+
assertsm.repoisparent# 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))
811816
# Adding a remote without fetching so would have no references
812-
sm.repo.create_remote('special','git@server-shouldnotmatter:repo.git')
813-
assertsm.rename(sm_name)issmandsm.name==sm_name
814-
assertnotsm.repo.is_dirty(index=True,working_tree=False,untracked_files=False)
815-
816-
new_path='renamed/myname'
817-
assertsm.move(new_path).name==new_path
818-
819-
new_sm_name="shortname"
820-
assertsm.rename(new_sm_name)issm
821-
assertsm.repo.is_dirty(index=True,working_tree=False,untracked_files=False)
822-
assertsm.exists()
823-
824-
sm_mod=sm.module()
825-
ifos.path.isfile(os.path.join(sm_mod.working_tree_dir,'.git'))==sm._need_gitfile_submodules(parent.git):
826-
assertsm_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+
assertnotsm.exists()
828821

829822
@with_rw_directory
830823
deftest_rename(self,rwdir):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp