Disable commit checks when no push rules are active
The refactoring in 0a8db3dc inadvertently caused commit checks to become active regardless of whether any rules were actually active. This significantly slowed pushes and caused repositories with large number of commits to time out.
We fix this by using push_rule_checks_commit?
since the existence of a
PushRule
is not sufficient to determine whether any rules are
active. This also eliminates the need to override
should_run_diff_validations?
, since the set of validations will only
contain the active ones.