fix: stop correctly when MAX_COMMITS_TO_CHECK is reached #10
Reference in New Issue
Block a user
No description provided.
Delete Branch "respect-MAX_COMMITS_TO_CHECK"
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?
Next fix for issue #8
The previous check for NUM_COMMITS_CHECKED less than MAX_COMMITS_TO_CHECK was being done, and if true the code would proceed into a loop that would call validate_commit_and_parents for every parent. The call for the first parent commit might result in many commits being checked in that parent chain, but the code would go on to also check any other parent commit(s). That resulted in more commits being checked than required.
The new logic checks the current
NUM_COMMITS_CHECKEDat the very start of validate_commit_and_parents and returns immediately if we have already reachedMAX_COMMITS_TO_CHECK- that works better for me locally.Note: there is also an issue with the way that the tree of parent commits typically end up being traversed. That is a separate issue, and I will think about how to improve that.