Skip to content

Commit

Permalink
Make sure that heads are actually present in repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed May 12, 2019
1 parent d3f906e commit fb1477d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dulwich/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit fb1477d

Please sign in to comment.