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

Appearance settings

Commit 9da24d4

Browse filesBrowse files
committed
add test for submodule path not owned by submodule case
1 parent 11839ab commit 9da24d4
Copy full SHA for 9da24d4

File tree

1 file changed

+22
-0
lines changed
Filter options

1 file changed

+22
-0
lines changed

‎test/test_submodule.py

Copy file name to clipboardExpand all lines: test/test_submodule.py
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,28 @@ def assert_exists(sm, value=True):
906906
assert osp.isdir(sm_module_path) == dry_run
907907
# end for each dry-run mode
908908

909+
@with_rw_directory
910+
def test_ignore_non_submodule_file(self, rwdir):
911+
parent = git.Repo.init(rwdir)
912+
913+
smp = osp.join(rwdir, "module")
914+
os.mkdir(smp)
915+
916+
with open(osp.join(smp, "a"), "w", encoding="utf-8") as f:
917+
f.write('test\n')
918+
919+
with open(osp.join(rwdir, ".gitmodules"), "w", encoding="utf-8") as f:
920+
f.write("[submodule \"a\"]\n")
921+
f.write(" path = module\n")
922+
f.write(" url = https://github.com/chaconinc/DbConnector\n")
923+
924+
parent.git.add(Git.polish_url(osp.join(smp, "a")))
925+
parent.git.add(Git.polish_url(osp.join(rwdir, ".gitmodules")))
926+
927+
parent.git.commit(message='test')
928+
929+
assert len(parent.submodules) == 0
930+
909931
@with_rw_directory
910932
def test_remove_norefs(self, rwdir):
911933
parent = git.Repo.init(osp.join(rwdir, "parent"))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.