diff --git a/src/pylorax/api/recipes.py b/src/pylorax/api/recipes.py index 8b0faa6c..700662f9 100644 --- a/src/pylorax/api/recipes.py +++ b/src/pylorax/api/recipes.py @@ -568,7 +568,7 @@ def list_commits(repo, branch, filename): :raises: Can raise errors from Ggit """ revwalk = Git.RevisionWalker.new(repo) - revwalk.set_sort_mode(Git.SortMode.TIME | Git.SortMode.REVERSE) + revwalk.set_sort_mode(Git.SortMode.TIME) branch_ref = "refs/heads/%s" % branch revwalk.push_ref(branch_ref) diff --git a/tests/pylorax/test_recipes.py b/tests/pylorax/test_recipes.py index cf1da3a2..cd6110cc 100644 --- a/tests/pylorax/test_recipes.py +++ b/tests/pylorax/test_recipes.py @@ -188,7 +188,7 @@ class GitRecipesTest(unittest.TestCase): commits = recipes.list_commits(self.repo, "master", "http-server.toml") self.assertEqual(len(commits), 2, "Wrong number of commits: %s" % commits) - self.assertEqual(commits[1].message, "Recipe http-server.toml reverted to commit %s" % revert_to) + self.assertEqual(commits[0].message, "Recipe http-server.toml reverted to commit %s" % revert_to) def test_10_tag_new_commit(self): """Test tagging a newer commit of a recipe"""