diff --git a/repo.py b/repo.py index b526e6ecf44413272613e653f8fd7bdac58220c4..bb56f8655a4145bdfc06f9e2c1c6d899f81c936b 100644 --- a/repo.py +++ b/repo.py @@ -1,4 +1,5 @@ import os +from itertools import islice try: from cStringIO import StringIO except ImportError: @@ -33,7 +34,7 @@ class RepoWrapper(dulwich.repo.Repo): if path: commits = (c1 for c1, c2 in pairwise(commits) if self._path_changed_between(path, c1, c2)) - return list(commits)[skip:][:max_commits] + return list(islice(commits, skip, max_commits)) def _history(self, commit): if commit is None: