Regex instead of cli git refspec check
Regex instead of cli git refspec check

Currently we call git unconditionally to validate refspecs. This is
fast but adds some delay when called for lot of refspecs.

This change introduces a regex for simple cases like refs/heads/* or
refs/heads/main.

BUG=203588036
PiperOrigin-RevId: 403430978
Change-Id: I82db51b7223fde0620c4fd38c747864e1bee9975

google/copybara,google/copybara,google/copybara