| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,8 +44,11 @@ | |||
| 44 | 44 | BaseIndexEntry, | |
| 45 | 45 | IndexEntry | |
| 46 | 46 | ) | |
| 47 | + from gitdb.test.lib import with_rw_directory | ||
| 47 | 48 | from git.index.fun import hook_path | |
| 48 | 49 | ||
| 50 | + import git | ||
| 51 | + | ||
| 49 | 52 | ||
| 50 | 53 | class TestIndex(TestBase): | |
| 51 | 54 | ||
@@ -765,3 +768,15 @@ def test_index_bare_add(self, rw_bare_repo): | |||
| 765 | 768 | except InvalidGitRepositoryError: | |
| 766 | 769 | asserted = True | |
| 767 | 770 | assert asserted, "Adding using a filename is not correctly asserted." | |
| 771 | + | ||
| 772 | + @with_rw_directory | ||
| 773 | + def test_index_add_corruption(self, rw_dir): | ||
| 774 | + # Test for https://github.com/gitpython-developers/GitPython/issues/265 | ||
| 775 | + repo = git.Repo.clone_from("git://pkgs.fedoraproject.org/GitPython", rw_dir) | ||
| 776 | + assert not repo.is_dirty() | ||
| 777 | + file_path = os.path.join(rw_dir, "GitPython.spec") | ||
| 778 | + open(file_path, 'wb').close() | ||
| 779 | + assert repo.is_dirty() | ||
| 780 | + repo.index.add(['0001-GPG-signature-support-on-commit-object.patch', 'GitPython.spec', '.gitignore', 'sources']) | ||
| 781 | + repo.git.commit(m="committing file") | ||
| 782 | + assert not repo.is_dirty() | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments