Skip to content

Commit 66c5b33

Browse files
committed
Minor improvements to submodule test for windows portability
However, most tests fail for reasons unknown - SHA cannot be found. For now, I will wait until someone complains, as I doubt too many people will use it on windows. Related to #244
1 parent 0ddbe4b commit 66c5b33

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: git/test/test_submodule.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ def test_git_submodules(self, rwdir):
689689
@with_rw_directory
690690
def test_git_submodule_compatibility(self, rwdir):
691691
parent = git.Repo.init(os.path.join(rwdir, 'parent'))
692-
sm_path = 'submodules/intermediate/one'
692+
sm_path = join_path_native('submodules', 'intermediate', 'one')
693693
sm = parent.create_submodule('mymodules/myname', sm_path, url=self._small_repo_url())
694694
parent.index.commit("added submodule")
695695

@@ -714,12 +714,12 @@ def assert_exists(sm, value=True):
714714
# end verify submodule 'style'
715715

716716
# test move
717-
new_sm_path = 'submodules/one'
717+
new_sm_path = join_path_native('submodules', 'one')
718718
sm.move(new_sm_path)
719719
assert_exists(sm)
720720

721721
# Add additional submodule level
722-
csm = sm.module().create_submodule('nested-submodule', 'nested-submodule/working-tree',
722+
csm = sm.module().create_submodule('nested-submodule', join_path_native('nested-submodule', 'working-tree'),
723723
url=self._small_repo_url())
724724
sm.module().index.commit("added nested submodule")
725725
sm_head_commit = sm.module().commit()
@@ -781,7 +781,7 @@ def test_rename(self, rwdir):
781781

782782
sm_mod = sm.module()
783783
if os.path.isfile(os.path.join(sm_mod.working_tree_dir, '.git')) == sm._need_gitfile_submodules(parent.git):
784-
assert sm_mod.git_dir.endswith(".git/modules/" + new_sm_name)
784+
assert sm_mod.git_dir.endswith(join_path_native('.git', 'modules', new_sm_name))
785785
# end
786786

787787
@with_rw_directory

0 commit comments

Comments
 (0)