Skip to content

Commit 4510ab1

Browse files
authored
Merge pull request #1905 from ivan-danilov/patch-2
Improved warning if multiple configurations match
2 parents 0fc14ad + 382147e commit 4510ab1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GitVersionCore/Configuration/ConfigExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,15 @@ public static BranchConfig GetConfigForBranch(this Config config, string branchN
183183
}
184184
catch (InvalidOperationException)
185185
{
186-
var matchingConfigs = String.Join("\n - ", matches.Select(m => m.Key));
186+
var matchingConfigs = String.Concat(matches.Select(m => $"\n - {m.Key}"));
187187
var picked = matches
188188
.Select(kvp => kvp.Value)
189189
.First();
190190

191191
// TODO check how to log this
192192
Console.WriteLine(
193193
$"Multiple branch configurations match the current branch branchName of '{branchName}'. " +
194-
$"Using the first matching configuration, '{picked}'. Matching configurations include: '{matchingConfigs}'");
194+
$"Using the first matching configuration, '{picked.Name}'. Matching configurations include:'{matchingConfigs}'");
195195

196196
return picked;
197197
}

0 commit comments

Comments
 (0)