Project.pm/Validator.pm: switch to refactored valid_branch_name check
commit1a55be7245d463aa84e274531cbdb0dd2bb8c743
authorKyle J. McKay <mackyle@gmail.com>
Sun, 27 Jun 2021 20:20:26 +0000 (27 13:20 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Sun, 27 Jun 2021 20:20:26 +0000 (27 13:20 -0700)
tree826e36ef5c7ac4d7cc628647f724ceca3c019c0c
parent5abec837ec5ed5ec195a54c241d5389e07d6f26d
Project.pm/Validator.pm: switch to refactored valid_branch_name check

Replace the haphazard regex that has become unmaintainable (and
incomplete) with a call to the new valid_branch_name function instead.

This results in more readable and maintainable code.

Be careful with the call out from Girocco::Validator as unusual
scoping is in effect while validating and an explicit call to the
actual Girocco::ValidUtil::valid_branch_name function must be used.
Together with that, be careful to avoid import name pollution too.

To make this easy, modify Girocco::Util to automatically use the
new Girocco::ValidUtil module and export its valid_branch_name
function along with all the other valid_xxx functions.

The other valid_xxx functions in Girocco::Util are just begging to
be moved into the new Girocco::ValidUtil module.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Girocco/Project.pm
Girocco/Util.pm
Girocco/Validator.pm