| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d4ce247 commit a223c7b
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -636,7 +636,7 @@ def move(self, module_path, configuration=True, module=True): | |||
| 636 | 636 | os.renames(cur_path, module_checkout_abspath) | |
| 637 | 637 | renamed_module = True | |
| 638 | 638 | ||
| 639 | - if self._need_gitfile_submodules(self.repo.git): | ||
| 639 | + if os.path.isfile(os.path.join(module_checkout_abspath, '.git')): | ||
| 640 | 640 | module_abspath = self._module_abspath(self.repo, self.path, self.name) | |
| 641 | 641 | self._write_git_file_and_module_config(module_checkout_abspath, module_abspath) | |
| 642 | 642 | # end handle git file rewrite | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -377,8 +377,6 @@ def _do_base_tests(self, rwrepo): | |||
| 377 | 377 | assert nsm.path == pmp | |
| 378 | 378 | assert rwrepo.submodules[0].path == pmp | |
| 379 | 379 | ||
| 380 | - # TODO lowprio: test remaining exceptions ... for now its okay, the code looks right | ||
| 381 | - | ||
| 382 | 380 | # REMOVE 'EM ALL | |
| 383 | 381 | ################ | |
| 384 | 382 | # if a submodule's repo has no remotes, it can't be added without an explicit url | |
@@ -636,8 +634,20 @@ def test_git_submodules(self, rwdir): | |||
| 636 | 634 | ||
| 637 | 635 | assert sm.exists() and sm.module_exists() | |
| 638 | 636 | ||
| 639 | - # test move and rename | ||
| 640 | - # TODO | ||
| 637 | + clone = git.Repo.clone_from(self._submodule_url(), | ||
| 638 | + os.path.join(parent.working_tree_dir, 'existing-subrepository')) | ||
| 639 | + sm2 = parent.create_submodule('nongit-file-submodule', clone.working_tree_dir) | ||
| 640 | + assert len(parent.submodules) == 2 | ||
| 641 | + | ||
| 642 | + for _ in range(2): | ||
| 643 | + for init in (False, True): | ||
| 644 | + sm.update(init=init) | ||
| 645 | + sm2.update(init=init) | ||
| 646 | + # end for each init state | ||
| 647 | + # end for each iteration | ||
| 648 | + | ||
| 649 | + sm.move(sm.path + '_moved') | ||
| 650 | + sm2.move(sm2.path + '_moved') | ||
| 641 | 651 | ||
| 642 | 652 | @with_rw_directory | |
| 643 | 653 | def test_git_submodule_compatibility(self, rwdir): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments