diff --git a/dulwich/repo.py b/dulwich/repo.py index 7c906429e..db3a7c1a7 100644 --- a/dulwich/repo.py +++ b/dulwich/repo.py @@ -447,7 +447,9 @@ def get_graph_walker(self, heads=None): :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())