We're updating the issue view to help you get more done. 

Build script helper function Parse-Version-From-ReleaseBranch incorrectly splits strings

Description

Currently a branch name (e.g. test/v1.2.3) is split using the following code (main_helper_functions.ps1 - Parse-Version-From-ReleaseBranch):

While this code looks like it does the correct thing, there is actually no overload of .Split taking only a string as parameter. Instead this will convert the string into a char array because there is an overload using a char array.

This produces invalid results because the .Split method will return three entries (e.g. "test/v1.2.3" -> "test", "", "1.2.3"). This causes the method to throw an exception on a correct branch name, breaking functionality like New-Version.

Instead the split should be written to use the correct overload (string[], StringSplitOptions):

Other useages of .Split in the build script work correctly because they either use the no-parameter overload or split based on a string with only one character, in which case the method behaves as excepted.

Fixed

Assignee

Raffael Foidl

Reporter

Patrick Widauer

Labels

None

Story Points

0.5

Time tracking

0m

Time remaining

15m

Components

Fix versions

Affects versions

Priority

Normal
Configure