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:

  2.16.8-17-gc8b633d5ce

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"
is returned.

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.

Change-Id: Ifab49a4d3985acce0dbdcbe54d89460bd7c3f027
2 files changed
tree: 97277e631225217766bf61cccfc3eaac16a1ad1f
  1. src/
  2. .gitignore
  3. BUCK
  4. BUILD
  5. LICENSE
  6. README.md
README.md

plugin-manager

Gerrit web-based plugin manager.

To enable this plugin, please look at the configuration guide