Skip to content
Snippets Groups Projects
Commit d7b8768d authored by Scott Chacon's avatar Scott Chacon
Browse files

reapplying defunkts changes

parent aa2dadf0
No related branches found
No related tags found
No related merge requests found
......@@ -360,8 +360,8 @@
def generate_pack_contents(self, want, have):
graph_walker = SimpleFetchGraphWalker(want, self.git.get_parents)
next = graph_walker.next()
shas = []
shas = set()
while next:
if next in have:
graph_walker.ack(next)
else:
......@@ -364,6 +364,6 @@
while next:
if next in have:
graph_walker.ack(next)
else:
shas.append(next)
shas.add(next)
next = graph_walker.next()
......@@ -369,5 +369,7 @@
next = graph_walker.next()
seen = []
# so now i have the shas, need to turn them into a list of
# tuples (sha, path) for ALL the objects i'm sending
# TODO : don't send blobs or trees they already have
......@@ -377,4 +379,7 @@
for (mode, name, sha) in tree.entries():
if mode == 57344: # TODO : properly handle submodules
continue
if sha in seen:
continue
obj = self.git.get_object(sha)
......@@ -380,4 +385,5 @@
obj = self.git.get_object(sha)
seen.append(sha)
if isinstance (obj, Blob):
changes.append((obj, path + name))
elif isinstance(obj, Tree):
......@@ -381,7 +387,7 @@
if isinstance (obj, Blob):
changes.append((obj, path + name))
elif isinstance(obj, Tree):
changes.extend (get_objects (obj, path + name + '/'))
changes.extend(get_objects(obj, path + name + '/'))
return changes
objects = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment