Mercurial > hg-git
diff hggit/git2hg.py @ 1007:2cd253b6c8ab
git2hg: protect incoming from looking up HEAD
It doesn't really make sense to look up HEAD since this is checking 'incoming'.
author | Sean Farley <sean@farley.io> |
---|---|
date | Fri, 15 May 2015 12:57:52 -0700 |
parents | 4f0b86da5e72 |
children | f1c4e2ba8ff9 |
line wrap: on
line diff
--- a/hggit/git2hg.py Fri May 15 11:40:49 2015 -0700 +++ b/hggit/git2hg.py Fri May 15 12:57:52 2015 -0700 @@ -22,10 +22,10 @@ def get_heads(refs): todo = [] seenheads = set() - for sha in refs.itervalues(): + for ref, sha in refs.iteritems(): # refs could contain refs on the server that we haven't pulled down - # the objects for - if sha in git_object_store: + # the objects for; also make sure it's a sha and not a symref + if ref != 'HEAD' and sha in git_object_store: obj = git_object_store[sha] while isinstance(obj, Tag): obj_type, sha = obj.object