Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1fd07a0

Browse files
committed
test(index): test forgitpython-developers#265
However, it doesn't reproduce on the latest version of GitPython.Maybe it's on an older one.
1 parent54e27f7 commit1fd07a0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎git/test/test_index.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@
4444
BaseIndexEntry,
4545
IndexEntry
4646
)
47+
fromgitdb.test.libimportwith_rw_directory
4748
fromgit.index.funimporthook_path
4849

50+
importgit
51+
4952

5053
classTestIndex(TestBase):
5154

@@ -765,3 +768,15 @@ def test_index_bare_add(self, rw_bare_repo):
765768
exceptInvalidGitRepositoryError:
766769
asserted=True
767770
assertasserted,"Adding using a filename is not correctly asserted."
771+
772+
@with_rw_directory
773+
deftest_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+
assertnotrepo.is_dirty()
777+
file_path=os.path.join(rw_dir,"GitPython.spec")
778+
open(file_path,'wb').close()
779+
assertrepo.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+
assertnotrepo.is_dirty()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp