Skip to content

Commit 191c6c1

Browse files
committed
fix(configuration): Enhance YAML merging logic for lists
1 parent c67b80f commit 191c6c1

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

src/GitVersion.Configuration/ConfigurationHelper.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,16 @@ private static void Merge(IDictionary<object, object?> dictionary, IReadOnlyDict
5858

5959
break;
6060
}
61-
case null or string or IList<object>:
61+
case IList:
62+
{
63+
if (anotherDictionary.TryGetValue(item.Key, out var value))
64+
{
65+
dictionary[item.Key] = value;
66+
}
67+
68+
break;
69+
}
70+
default:
6271
{
6372
if (anotherDictionary.TryGetValue(item.Key, out var value))
6473
{
@@ -83,7 +92,16 @@ private static void Merge(IDictionary<object, object?> dictionary, IReadOnlyDict
8392
dictionary.Add(item.Key, anotherDictionaryValue);
8493
break;
8594
}
86-
case null or string or IList<object>:
95+
case IList:
96+
{
97+
if (!dictionary.ContainsKey(item.Key))
98+
{
99+
dictionary.Add(item.Key, item.Value);
100+
}
101+
102+
break;
103+
}
104+
default:
87105
{
88106
if (!dictionary.ContainsKey(item.Key))
89107
{

0 commit comments

Comments
 (0)