瀏覽代碼

Remove unused import, always ensure that objects is serialized before running check().

Jelmer Vernooij 15 年之前
父節點
當前提交
fa647db38b
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 2
      dulwich/objects.py
  2. 1 0
      dulwich/tests/test_objects.py

+ 1 - 2
dulwich/objects.py

@@ -28,7 +28,6 @@ from cStringIO import (
 import mmap
 import os
 import stat
-import time
 import zlib
 
 from dulwich.errors import (
@@ -294,7 +293,7 @@ class ShaFile(object):
         # check() method during optimization so we can still check the object
         # when necessary.
         try:
-            self._deserialize(self._chunked_text)
+            self._deserialize(self.as_raw_chunks())
         except Exception, e:
             raise ObjectFormatException(e)
 

+ 1 - 0
dulwich/tests/test_objects.py

@@ -477,6 +477,7 @@ class TagParseTests(ShaFileCheckTests):
 
 
 class CheckTests(unittest.TestCase):
+
     def test_check_hexsha(self):
         check_hexsha(a_sha, "failed to check good sha")
         self.assertRaises(ObjectFormatException, check_hexsha, '1' * 39,