浏览代码

Remove unused ShaFile._make_sha.

Jelmer Vernooij 9 年之前
父节点
当前提交
2341f7e6a2
共有 2 个文件被更改,包括 1 次插入8 次删除
  1. 0 7
      dulwich/objects.py
  2. 1 1
      dulwich/tests/test_objects.py

+ 0 - 7
dulwich/objects.py

@@ -463,13 +463,6 @@ class ShaFile(object):
             ret += len(chunk)
         return ret
 
-    def _make_sha(self):
-        ret = sha1()
-        ret.update(self._header())
-        for chunk in self.as_raw_chunks():
-            ret.update(chunk)
-        return ret
-
     def sha(self):
         """The SHA1 object that is the name of this object."""
         if self._sha is None or self._needs_serialization:

+ 1 - 1
dulwich/tests/test_objects.py

@@ -231,7 +231,7 @@ class BlobReadTests(TestCase):
         c = make_commit(id=sha, message=b'foo')
         self.assertTrue(isinstance(c, Commit))
         self.assertEqual(sha, c.id)
-        self.assertNotEqual(sha, c._make_sha())
+        self.assertNotEqual(sha, c.sha())
 
 
 class ShaFileCheckTests(TestCase):