Fix small off-by-one inaccuracy

Thanks to @tobikrs in #10
This commit is contained in:
Tobias Kunze 2023-08-03 04:01:01 +02:00
parent eeae8c8984
commit d9abd5c921

View file

@ -93,10 +93,9 @@ def rewrite_history(
# first, choose the date # first, choose the date
date_index = round(progress * (duration - 1)) date_index = round(progress * (duration - 1))
date = days[date_index] date = days[date_index]
if not last_timestamp or date == last_timestamp.date(): if not last_timestamp or date != last_timestamp.date():
day_progress += 1
else:
day_progress = 0 day_progress = 0
day_progress += 1
# if we only have one commit per day at most, we can use the whole day. # if we only have one commit per day at most, we can use the whole day.
# otherwise, we need to limit the time range further to avoid collisions. # otherwise, we need to limit the time range further to avoid collisions.