mirror of
https://github.com/artiebits/fake-git-history.git
synced 2026-04-26 23:45:56 +03:00
[GH-ISSUE #42] The loop's condition feels off #17
Labels
No labels
good first issue
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-git-history#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @djalilhebal on GitHub (Oct 23, 2023).
Original GitHub issue: https://github.com/artiebits/fake-git-history/issues/42
First of all, nice utility.
I just checked its source code and the loop's condition felt off.
The end result will be fine (always < max commits per day), but it seems as if it's "changing its mind"...
Imagine the following execution of
i < getRandomIntInclusive(0, 2):0 < 11 < 22 < 0A simple edit should make the intention clearer:
@smcnary commented on GitHub (Oct 23, 2023):
Is the list on the my-history file supposed to be 1 entry or all the entries? Because on mine it's just the last entry in the block.
@artiebits commented on GitHub (Oct 23, 2023):
hi @djalilhebal,
a good catch, because it's actually a bug. indeed, the
getRandomIntInclusiveis being called on every iteration of the for loop. feel free to open a PR and fix it!@artiebits commented on GitHub (Oct 29, 2023):
solved in #43