|
@@ -91,11 +91,31 @@ class GitBackend(Backend):
|
|
|
|
|
|
commits_to_send = want[:]
|
|
commits_to_send = want[:]
|
|
for sha in commits_to_send:
|
|
for sha in commits_to_send:
|
|
|
|
+ if sha in sha_queue:
|
|
|
|
+ continue
|
|
|
|
+
|
|
sha_queue.append((1,sha))
|
|
sha_queue.append((1,sha))
|
|
|
|
|
|
c = self.repo.commit(sha)
|
|
c = self.repo.commit(sha)
|
|
for p in c.parents():
|
|
for p in c.parents():
|
|
- commits_to_send.append(p)
|
|
|
|
|
|
+ if not p in commits_to_send:
|
|
|
|
+ commits_to_send.append(p)
|
|
|
|
+
|
|
|
|
+ def parse_tree(tree, sha_queue):
|
|
|
|
+ for mode, name, x in tree.entries():
|
|
|
|
+ if not x in sha_queue:
|
|
|
|
+ try:
|
|
|
|
+ t = self.repo.get_tree(x)
|
|
|
|
+ sha_queue.append((2, x))
|
|
|
|
+ parse_tree(t, sha_queue)
|
|
|
|
+ except:
|
|
|
|
+ sha_queue.append((3, x))
|
|
|
|
+
|
|
|
|
+ treesha = c.tree()
|
|
|
|
+ if treesha not in sha_queue:
|
|
|
|
+ sha_queue.append((2, treesha))
|
|
|
|
+ t = self.repo.get_tree(treesha)
|
|
|
|
+ parse_tree(t, sha_queue)
|
|
|
|
|
|
progress("counting objects: %d\r" % len(sha_queue))
|
|
progress("counting objects: %d\r" % len(sha_queue))
|
|
|
|
|