Skip to content

[Bug] /overrideconfig breaks configuration #2292

@Inok

Description

@Inok

When I specify /overrideconfig, GitVersion breaks with the following error:

System.Collections.Generic.KeyNotFoundException: The given key 'develop' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at GitVersion.RepositoryMetadataProvider.GetChosenBranch(Config configuration) in D:\a\GitVersion\GitVersion\src\GitVersionCore\Core\RepositoryMetadataProvider.cs:line 208
   at GitVersion.Configuration.BranchConfigurationCalculator.InheritBranchConfiguration(Branch targetBranch, BranchConfig branchConfiguration, Commit currentCommit, Config configuration, IList`1 exclud
edInheritBranches) in D:\a\GitVersion\GitVersion\src\GitVersionCore\Configuration\BranchConfigurationCalculator.cs:line 124
...

Looks like the reason is ConfigExtensions.ApplyOverridesTo() implementation, which was changed at #2200, and since that PR it just overwrites everything instead of overriding explicitly specified configs.

Expected Behavior

/overrideconfig must not overwrite all configuration, it should override specified configs (we use it with 'tag-prefix').

Your Environment

Affected versions: 5.3.0+ (5.2.4 works great)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions