| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + gitdir: ./.real | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,6 @@ | |||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | class TestRepo(TestBase): | |
| 27 | - | ||
| 28 | 27 | @raises(InvalidGitRepositoryError) | |
| 29 | 28 | def test_new_should_raise_on_invalid_repo_location(self): | |
| 30 | 29 | Repo(tempfile.gettempdir()) | |
@@ -615,3 +614,20 @@ def test_submodule_update(self, rwrepo): | |||
| 615 | 614 | assert isinstance(sm, Submodule) | |
| 616 | 615 | ||
| 617 | 616 | # note: the rest of this functionality is tested in test_submodule | |
| 617 | + | ||
| 618 | + @with_rw_repo('HEAD') | ||
| 619 | + def test_git_file(self, rwrepo): | ||
| 620 | + # Move the .git directory to another location and create the .git file. | ||
| 621 | + real_path_abs = os.path.abspath(join_path_native(rwrepo.working_tree_dir, '.real')) | ||
| 622 | + os.rename(rwrepo.git_dir, real_path_abs) | ||
| 623 | + git_file_path = join_path_native(rwrepo.working_tree_dir, '.git') | ||
| 624 | + open(git_file_path, 'wb').write(fixture('git_file')) | ||
| 625 | + | ||
| 626 | + # Create a repo and make sure it's pointing to the relocated .git directory. | ||
| 627 | + git_file_repo = Repo(rwrepo.working_tree_dir) | ||
| 628 | + assert os.path.abspath(git_file_repo.git_dir) == real_path_abs | ||
| 629 | + | ||
| 630 | + # Test using an absolute gitdir path in the .git file. | ||
| 631 | + open(git_file_path, 'wb').write('gitdir: %s\n' % real_path_abs) | ||
| 632 | + git_file_repo = Repo(rwrepo.working_tree_dir) | ||
| 633 | + assert os.path.abspath(git_file_repo.git_dir) == real_path_abs | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments