make hotfix use a plus instead of minus (#32060)

This commit is contained in:
Jonah Williams
2019-05-07 10:11:00 -07:00
committed by GitHub
parent 2f1e7cf662
commit eb996afaa8
2 changed files with 6 additions and 6 deletions

View File

@@ -572,7 +572,7 @@ class GitTagVersion {
/// The Z in vX.Y.Z.
final int z;
/// the F in vX.Y.Z-hotfix.F
/// the F in vX.Y.Z+hotfix.F
final int hotfix;
/// Number of commits since the vX.Y.Z tag.
@@ -586,7 +586,7 @@ class GitTagVersion {
}
static GitTagVersion parse(String version) {
final RegExp versionPattern = RegExp(r'^v([0-9]+)\.([0-9]+)\.([0-9]+)(?:-hotfix\.([0-9]+))?-([0-9]+)-g([a-f0-9]+)$');
final RegExp versionPattern = RegExp(r'^v([0-9]+)\.([0-9]+)\.([0-9]+)(?:\+hotfix\.([0-9]+))?-([0-9]+)-g([a-f0-9]+)$');
final List<String> parts = versionPattern.matchAsPrefix(version)?.groups(<int>[1, 2, 3, 4, 5, 6]);
if (parts == null) {
printTrace('Could not interpret results of "git describe": $version');
@@ -601,11 +601,11 @@ class GitTagVersion {
return '0.0.0-unknown';
if (commits == 0) {
if (hotfix != null)
return '$x.$y.$z-hotfix.$hotfix';
return '$x.$y.$z+hotfix.$hotfix';
return '$x.$y.$z';
}
if (hotfix != null)
return '$x.$y.$z-hotfix.${hotfix + 1}-pre.$commits';
return '$x.$y.$z+hotfix.${hotfix + 1}-pre.$commits';
return '$x.$y.${z + 1}-pre.$commits';
}
}