From bc9b9a582994d30c6c8e6c0ae5d7aca121cabaa4 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Mon, 18 Mar 2024 22:56:54 +0100 Subject: [PATCH] use correct number of total commits for large pushes --- app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index ae204eb..5cd30e2 100644 --- a/app.py +++ b/app.py @@ -41,15 +41,16 @@ def main(): pr_url = None commits = data["commits"] - commit_count = f"{len(commits)} commit{'s' if len(commits) > 1 else ''}" + total_commits = data.get("total_commits", len(commits)) + commit_count = f"{total_commits} commit{'s' if total_commits > 1 else ''}" message = "[inlinecode]" + commits[0]["message"].split('\n',1)[0] + "[/inlinecode]" - if len(commits) <= 1: + if total_commits <= 1: others = "" - elif len(commits) == 2: + elif total_commits == 2: others = " (et 1 autre commit)" else: - others = f" (et {len(commits)-1} autres commits)" + others = f" (et {total_commits-1} autres commits)" url_user = make_url_user(data['pusher'])