Explorar o código

make .id available for all sha_files.

Jelmer Vernooij %!s(int64=16) %!d(string=hai) anos
pai
achega
f95bc5f19c
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      dulwich/objects.py

+ 4 - 4
dulwich/objects.py

@@ -158,6 +158,10 @@ class ShaFile(object):
     ressha.update(self._text)
     return ressha
 
+  @property
+  def id(self):
+      return self.sha().hexdigest()
+
   def __eq__(self, other):
     """Return true id the sha of the two objects match.
 
@@ -365,10 +369,6 @@ class Commit(ShaFile):
     """
     return self._commit_time
 
-  @property
-  def id(self):
-      return self.sha().hexdigest()
-
 type_map = {
   blob_id : Blob,
   tree_id : Tree,