Support custom fields in commits.
[jelmer/dulwich-libgit2.git] / dulwich / tests / test_objects.py
index baea3b12389a4faaa23fa2636244e3b8400b74f2..38a7ac823d75c6fe4fbe946a50669647c777229f 100644 (file)
@@ -225,6 +225,18 @@ class CommitDeserializationTests(unittest.TestCase):
                           '4cffe90e0a41ad3f5190079d7c8f036bde29cbe6'],
             c.parents)
 
                           '4cffe90e0a41ad3f5190079d7c8f036bde29cbe6'],
             c.parents)
 
+    def test_custom(self):
+        c = Commit.from_string(
+                'tree d80c186a03f423a81b39df39dc87fd269736ca86\n'
+                'parent ab64bbdcc51b170d21588e5c5d391ee5c0c96dfd\n'
+                'parent 4cffe90e0a41ad3f5190079d7c8f036bde29cbe6\n'
+                'author James Westby <jw+debian@jameswestby.net> 1174773719 +0000\n'
+                'committer James Westby <jw+debian@jameswestby.net> 1174773719 +0000\n'
+                'extra-field data\n'
+                '\n'
+                'Merge ../b\n')
+        self.assertEquals('data', c.extra['extra-field'])
+
 
 class TreeSerializationTests(unittest.TestCase):
 
 
 class TreeSerializationTests(unittest.TestCase):