| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 11839ab commit 9da24d4
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -906,6 +906,28 @@ def assert_exists(sm, value=True): | |||
| 906 | 906 | assert osp.isdir(sm_module_path) == dry_run | |
| 907 | 907 | # end for each dry-run mode | |
| 908 | 908 | ||
| 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 | + | ||
| 909 | 931 | @with_rw_directory | |
| 910 | 932 | def test_remove_norefs(self, rwdir): | |
| 911 | 933 | parent = git.Repo.init(osp.join(rwdir, "parent")) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments