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

Commit31fd955

Browse files
committed
BF: @with_rw_directory must return decorated call
As it was - many tests were simply not accounted/run at all
1 parentf2b92c6 commit31fd955

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

‎git/test/lib/helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ def wrapper(self):
107107
gc.collect()
108108
ifnotkeep:
109109
rmtree(path)
110+
wrapper.__name__=func.__name__
111+
returnwrapper
110112

111113

112114
defwith_rw_repo(working_tree_ref,bare=False):

‎git/test/test_submodule.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ def _do_base_tests(self, rwrepo):
317317
# forcibly delete the child repository
318318
prev_count=len(sm.children())
319319
self.failUnlessRaises(ValueError,csm.remove,force=True)
320-
# We removed sm, which removed all submodules.Howver, the instance we have
321-
# still points to the commit prior to that, where it still existed
320+
# We removed sm, which removed all submodules.However, the instance we
321+
#havestill points to the commit prior to that, where it still existed
322322
csm.set_parent_commit(csm.repo.commit(),check=False)
323323
assertnotcsm.exists()
324324
assertnotcsm.module_exists()
@@ -801,6 +801,31 @@ def assert_exists(sm, value=True):
801801
assertos.path.isdir(sm_module_path)==dry_run
802802
# end for each dry-run mode
803803

804+
@with_rw_directory
805+
deftest_remove_norefs(self,rwdir):
806+
parent=git.Repo.init(os.path.join(rwdir,'parent'))
807+
sm_name='mymodules/myname'
808+
sm=parent.create_submodule(sm_name,sm_name,url=self._small_repo_url())
809+
parent.index.commit("Added submodule")
810+
811+
# 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
828+
804829
@with_rw_directory
805830
deftest_rename(self,rwdir):
806831
parent=git.Repo.init(os.path.join(rwdir,'parent'))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp