This reworks the way we handle the prerelease version. Before if you had a less than 9 character branch that started with a number, we would prepend the letter a, then take the first 9 characters. This would result in an exception. Further, if you had a greater than 10 character branch name, we would remove the - in it and take the first 10 characters from that. With an 11 character branch with 2 - this would be an error as the max length to take is 9. Instead now we will work just on the part of the string we're fixing, with the max length being the last one handled.
Motivation and Context
Prevent some edge cases where the build fails.
Testing
Copy the files from this PR into the correct place in the Chocolatey/choco repository.
Run the build there for branches named: 3465-msi, gh-3465-msi, gh-3465-msi1.
Note that the build now succeeds.
Operating Systems Testing
Windows 10
Change Types Made
[x] Bug fix (non-breaking change).
[ ] Feature / Enhancement (non-breaking change).
[ ] Breaking change (fix or feature that could cause existing functionality to change).
Description Of Changes
This reworks the way we handle the prerelease version. Before if you had a less than 9 character branch that started with a number, we would prepend the letter a, then take the first 9 characters. This would result in an exception. Further, if you had a greater than 10 character branch name, we would remove the
-
in it and take the first 10 characters from that. With an 11 character branch with 2-
this would be an error as the max length to take is 9. Instead now we will work just on the part of the string we're fixing, with the max length being the last one handled.Motivation and Context
Prevent some edge cases where the build fails.
Testing
3465-msi
,gh-3465-msi
,gh-3465-msi1
.Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #162