Procházet zdrojové kódy

Simplify get_parents

milki před 11 roky
rodič
revize
65794a9c53
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 3 3
      dulwich/repo.py

+ 3 - 3
dulwich/repo.py

@@ -329,10 +329,10 @@ class BaseRepo(object):
         :return: List of parents
         """
 
-        if sha in self.graftpoints:
+        try:
             return self.graftpoints[sha]
-        else:
-            return self.commit(sha).parents
+        except KeyError:
+            return self[sha].parents
 
     def get_config(self):
         """Retrieve the config object.