From fd99e6fe49ca0c3638f888747bd5bc2b380ef316 Mon Sep 17 00:00:00 2001 From: Sean Farley Date: Fri, 15 May 2015 12:57:52 -0700 Subject: [PATCH] git2hg: protect incoming from looking up HEAD It doesn't really make sense to look up HEAD since this is checking 'incoming'. --- hggit/git2hg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hggit/git2hg.py b/hggit/git2hg.py index 7d27631081..b6a4713abd 100644 --- a/hggit/git2hg.py +++ b/hggit/git2hg.py @@ -22,10 +22,10 @@ def find_incoming(git_object_store, git_map, refs): 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