changeset 791:9a89e9cf41b7

git2hg.find_incoming: drop unnecessary if statement
author Siddharth Agarwal <sid0@fb.com>
date Wed, 15 Oct 2014 11:40:12 -0700
parents 77416ddca136
children ad0bad8a0700
files hggit/git2hg.py
diffstat 1 files changed, 10 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/git2hg.py
+++ b/hggit/git2hg.py
@@ -16,18 +16,17 @@
 
     # get a list of all the head shas
     seenheads = set()
-    if refs:
-        for sha in refs.itervalues():
-            # refs contains all the refs in the server, not just the ones
-            # we are pulling
-            if sha in git_object_store:
+    for sha in refs.itervalues():
+        # refs contains all the refs in the server, not just the ones
+        # we are pulling
+        if sha in git_object_store:
+            obj = git_object_store[sha]
+            while isinstance(obj, Tag):
+                obj_type, sha = obj.object
                 obj = git_object_store[sha]
-                while isinstance(obj, Tag):
-                    obj_type, sha = obj.object
-                    obj = git_object_store[sha]
-                if isinstance (obj, Commit) and sha not in seenheads:
-                    seenheads.add(sha)
-                    todo.append(sha)
+            if isinstance (obj, Commit) and sha not in seenheads:
+                seenheads.add(sha)
+                todo.append(sha)
 
     # sort by commit date
     def commitdate(sha):