Skip to content

Commit

Permalink
Simplify tree update in commit method
Browse files Browse the repository at this point in the history
  • Loading branch information
white-gecko committed Aug 20, 2019
1 parent 80b1cea commit dd7dbdd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions quit/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,10 @@ def commit(self, message, author_name, author_email, **kwargs):
author = pygit2.Signature(author_name, author_email)
commiter = pygit2.Signature(commiter_name, commiter_email)

# Sort index items
items = sorted(self.stash.items(), key=lambda x: (x[1][0], x[0]))

# Create tree
tree = IndexTree(self)
while len(items) > 0:
path, (oid, mode) = items.pop(0)

for path, (oid, mode) in self.stash.items():
if oid is None:
tree.remove(path)
else:
Expand Down

0 comments on commit dd7dbdd

Please sign in to comment.