← Back to team overview

dulwich-users team mailing list archive

[PATCH 19/33] pack: use SEEK_END for PackData.get_stored_checksum().

 

From: Dave Borowitz <dborowitz@xxxxxxxxxx>

Change-Id: I45e7f018b12875f08f44448edad0f9c5837e4c4d
---
 dulwich/pack.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dulwich/pack.py b/dulwich/pack.py
index 638ea55..acdddcc 100644
--- a/dulwich/pack.py
+++ b/dulwich/pack.py
@@ -74,6 +74,7 @@ from dulwich.lru_cache import (
     )
 from dulwich._compat import (
     make_sha,
+    SEEK_CUR,
     SEEK_END,
     )
 from dulwich.objects import (
@@ -1005,7 +1006,7 @@ class PackData(object):
 
     def get_stored_checksum(self):
         """Return the expected checksum stored in this pack."""
-        self._file.seek(self._get_size()-20)
+        self._file.seek(-20, SEEK_END)
         return self._file.read(20)
 
     def check(self):
-- 
1.7.3.1



References