Ver Fonte

Remove get_commit_parents, it's too trivial.

Jelmer Vernooij há 16 anos atrás
pai
commit
29339d9e3a
2 ficheiros alterados com 2 adições e 10 exclusões
  1. 1 9
      dulwich/object_store.py
  2. 1 1
      dulwich/repo.py

+ 1 - 9
dulwich/object_store.py

@@ -109,21 +109,13 @@ class BaseObjectStore(object):
         """
         return iter(MissingObjectFinder(self, haves, wants, progress).next, None)
 
-    def get_commit_parents(self, sha):
-        """Retrieve the parents of a commit.
-
-        :param sha: SHA1 of the commit
-        :return: List of parent SHA1s
-        """
-        return self[sha].parents
-
     def get_graph_walker(self, heads):
         """Obtain a graph walker for this object store.
         
         :param heads: Local heads to start search with
         :return: GraphWalker object
         """
-        return ObjectStoreGraphWalker(heads, self.get_commit_parents)
+        return ObjectStoreGraphWalker(heads, lambda sha: self[sha].parents)
 
 
 class DiskObjectStore(BaseObjectStore):

+ 1 - 1
dulwich/repo.py

@@ -298,7 +298,7 @@ class Repo(object):
         return self.object_store[sha]
 
     def get_parents(self, sha):
-        return self.object_store.get_commit_parents(sha)
+        return self.commit(sha).parents
 
     def commit(self, sha):
         return self._get_object(sha, Commit)