change: Change order of commit validation routine

We currently validate all commits going from latest -> oldest.

It would be nicer to go oldest -> latest so that, in case of errors,
we would indicate which commit "introduced" the problem.

Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
moson 2023-07-22 10:43:19 +02:00
parent bc03d8b8f2
commit 347c2ce721
No known key found for this signature in database
GPG key ID: 4A4760AB4EE15296
2 changed files with 7 additions and 2 deletions

View file

@ -356,7 +356,7 @@ def main(): # noqa: C901
die("denying non-fast-forward (you should pull first)")
# Prepare the walker that validates new commits.
walker = repo.walk(sha1_new, pygit2.GIT_SORT_TOPOLOGICAL)
walker = repo.walk(sha1_new, pygit2.GIT_SORT_REVERSE)
if sha1_old != "0" * 40:
walker.hide(sha1_old)