use correct number of total commits for large pushes
This commit is contained in:
parent
6ff873fb9f
commit
bc9b9a5829
9
app.py
9
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'])
|
||||
|
||||
|
|
Loading…
Reference in New Issue