GerritVersionBranch: Fix branch detection for 3.0.0-rcx versions
The detection assumes that any version string that includes "-" in
the 'minor' version is a git describe generated version, such as:
and treats it as the 'next' version. This logic does not take into
account that the latest release version 3.0.0 has the explicit trailing
".0" on it, so the version "3.0.0-rc3" is parsed incorrectly and "master"
Change the condition to check for "-g" instead, since "g" is always
included before the abbreviated sha1 in a git describe version.
Add tests to confirm that it behaves as expected for various forms
of version string.
2 files changed