瀏覽代碼

Make sure that heads are actually present in repository.

Jelmer Vernooij 6 年之前
父節點
當前提交
fb1477d9d1
共有 1 個文件被更改,包括 3 次插入1 次删除
  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())