[Bugfix] GitVersion crashes if there are multiple branches containing the keyword develop and the current branch has Increment policy set to Inherit with current commit being a merge commit #1410
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
In case there are multiple branches containing the keyword
develop
and the current branch has an increment policy set to inherit e.g.feature/x
, if the current commit is a merge commit, GitVersion crashes.Root Cause
In case of merge commits, GitVersion derives the branch configuration from
master
ordevelop
. When multiple develops exist, any one of them can be selected, in case of the attached test repo it isbob_develop
. While trying to derive the configuration ofbob_develop
, the regex is modified inConfig.cs
as shown in the changelist. This causes a regex mismatch and hence the invalid configuration attached tobob_develop
Fix
Remove the
^
added to the branch regex. Either the^
should be present in the branch regex itself or not at all.Attached is a repo where this problem can be reproduced.
test-repo.zip