From dd7dbdd829aea3ca0317cafd453e20557bbdb447 Mon Sep 17 00:00:00 2001 From: Natanael Arndt Date: Tue, 20 Aug 2019 17:35:37 +0200 Subject: [PATCH] Simplify tree update in commit method --- quit/git.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/quit/git.py b/quit/git.py index d3d95bf4..2010895b 100644 --- a/quit/git.py +++ b/quit/git.py @@ -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: