Changeset - c4c2df844424
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2019-12-26 04:07:03
mads@kiilerich.com
Grafted from: 63c54eaaa78e
py3: zip will return an iterator - apply list before reversing
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/git/inmemory.py
Show inline comments
 
@@ -104,25 +104,25 @@ class GitInMemoryChangeset(BaseInMemoryC
 
            tree = commit_tree
 
            trees = [tree]
 
            # Traverse deep into the forest...
 
            for path in paths:
 
                try:
 
                    obj = self.repository._repo[tree[path][1]]
 
                    if isinstance(obj, objects.Tree):
 
                        trees.append(obj)
 
                        tree = obj
 
                except KeyError:
 
                    break
 
            # Cut down the blob and all rotten trees on the way back...
 
            for path, tree in reversed(zip(paths, trees)):
 
            for path, tree in reversed(list(zip(paths, trees))):
 
                del tree[path]
 
                if tree:
 
                    # This tree still has elements - don't remove it or any
 
                    # of it's parents
 
                    break
 

	
 
        object_store.add_object(commit_tree)
 

	
 
        # Create commit
 
        commit = objects.Commit()
 
        commit.tree = commit_tree.id
 
        commit.parents = [p._commit.id for p in self.parents if p]
0 comments (0 inline, 0 general)