summaryrefslogtreecommitdiff
path: root/git/test
diff options
context:
space:
mode:
authorVincent Driessen <me@nvie.com>2016-05-30 16:38:43 +0200
committerVincent Driessen <me@nvie.com>2016-05-30 16:38:43 +0200
commitf15d3a553db0150824bc6c0c67467735ec739cb8 (patch)
treef98ac23b1476a1771cfb9ecaf6a187d879a4ee67 /git/test
parent1faf84f8eb760b003ad2be81432443bf443b82e6 (diff)
parent79c99c0f66c8f3c8d13258376c82125a23b1b5c8 (diff)
downloadgitpython-patches.tar.gz
Merge branch 'fix-for-invalid-data-in-commits' into patchespatches
Diffstat (limited to 'git/test')
-rw-r--r--git/test/fixtures/commit_invalid_data6
-rw-r--r--git/test/test_commit.py7
2 files changed, 13 insertions, 0 deletions
diff --git a/git/test/fixtures/commit_invalid_data b/git/test/fixtures/commit_invalid_data
new file mode 100644
index 00000000..d112bf2d
--- /dev/null
+++ b/git/test/fixtures/commit_invalid_data
@@ -0,0 +1,6 @@
+tree 9f1a495d7d9692d24f5caedaa89f5c2c32d59368
+parent 492ace2ffce0e426ebeb55e364e987bcf024dd3b
+author E.Azer KoÃoÃoÃoculu <azer@kodfabrik.com> 1306710073 +0300
+committer E.Azer KoÃoÃoÃoculu <azer@kodfabrik.com> 1306710073 +0300
+
+add environjs
diff --git a/git/test/test_commit.py b/git/test/test_commit.py
index 23b7154a..ea8cd9af 100644
--- a/git/test/test_commit.py
+++ b/git/test/test_commit.py
@@ -306,6 +306,13 @@ class TestCommit(TestBase):
# it appears
cmt.author.__repr__()
+ def test_invalid_commit(self):
+ cmt = self.rorepo.commit()
+ cmt._deserialize(open(fixture_path('commit_invalid_data'), 'rb'))
+
+ assert cmt.author.name == u'E.Azer Ko�o�o�oculu', cmt.author.name
+ assert cmt.author.email == 'azer@kodfabrik.com', cmt.author.email
+
def test_gpgsig(self):
cmt = self.rorepo.commit()
cmt._deserialize(open(fixture_path('commit_with_gpgsig'), 'rb'))