Browse Source

Make sure that heads are actually present in repository.

Jelmer Vernooij 6 years ago
parent
commit
fb1477d9d1
1 changed files with 3 additions and 1 deletions
  1. 3 1
      dulwich/repo.py

+ 3 - 1
dulwich/repo.py

@@ -447,7 +447,9 @@ class BaseRepo(object):
         :return: A graph walker object
         """
         if heads is None:
-            heads = self.refs.as_dict(b'refs/heads').values()
+            heads = [
+                sha for sha in self.refs.as_dict(b'refs/heads').values()
+                if sha in self.object_store]
         return ObjectStoreGraphWalker(
             heads, self.get_parents, shallow=self.get_shallow())