diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-04-07 18:27:16 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-04-07 18:27:16 +0200 |
commit | 1fd07a0a7a6300db1db8b300a3f567b31b335570 (patch) | |
tree | 050be5b3266984bff40d61ed514074052838c4f8 /git/test | |
parent | 54e27f7bbb412408bbf0d2735b07d57193869ea6 (diff) | |
download | gitpython-1fd07a0a7a6300db1db8b300a3f567b31b335570.tar.gz |
test(index): test for #265
However, it doesn't reproduce on the latest version of GitPython.
Maybe it's on an older one.
Diffstat (limited to 'git/test')
-rw-r--r-- | git/test/test_index.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/git/test/test_index.py b/git/test/test_index.py index 63f99f10..8124ec16 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -44,8 +44,11 @@ from git.index.typ import ( BaseIndexEntry, IndexEntry ) +from gitdb.test.lib import with_rw_directory from git.index.fun import hook_path +import git + class TestIndex(TestBase): @@ -765,3 +768,15 @@ class TestIndex(TestBase): except InvalidGitRepositoryError: asserted = True assert asserted, "Adding using a filename is not correctly asserted." + + @with_rw_directory + def test_index_add_corruption(self, rw_dir): + # Test for https://github.com/gitpython-developers/GitPython/issues/265 + repo = git.Repo.clone_from("git://pkgs.fedoraproject.org/GitPython", rw_dir) + assert not repo.is_dirty() + file_path = os.path.join(rw_dir, "GitPython.spec") + open(file_path, 'wb').close() + assert repo.is_dirty() + repo.index.add(['0001-GPG-signature-support-on-commit-object.patch', 'GitPython.spec', '.gitignore', 'sources']) + repo.git.commit(m="committing file") + assert not repo.is_dirty() |