From 359b55340d8a09e279be0463c5870d5e94cf0590 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Fri, 18 Jul 2025 15:14:34 +0200 Subject: [PATCH] Ensure we assign record with with syntax to ensure we do not update shared instances of repository --- .../Assembler/AssemblyConfiguration.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Elastic.Documentation.Configuration/Assembler/AssemblyConfiguration.cs b/src/Elastic.Documentation.Configuration/Assembler/AssemblyConfiguration.cs index bddde6e2e..472b7715e 100644 --- a/src/Elastic.Documentation.Configuration/Assembler/AssemblyConfiguration.cs +++ b/src/Elastic.Documentation.Configuration/Assembler/AssemblyConfiguration.cs @@ -51,13 +51,13 @@ private static TRepository RepositoryDefaults(TRepository r, string // ReSharper disable NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract var repository = r ?? new TRepository(); // ReSharper restore NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract - repository.Name = name; - if (string.IsNullOrEmpty(repository.GitReferenceCurrent)) - repository.GitReferenceCurrent = "main"; - if (string.IsNullOrEmpty(repository.GitReferenceNext)) - repository.GitReferenceNext = "main"; - if (string.IsNullOrEmpty(repository.GitReferenceEdge)) - repository.GitReferenceEdge = "main"; + repository = repository with + { + Name = name, + GitReferenceCurrent = string.IsNullOrEmpty(repository.GitReferenceCurrent) ? "main" : repository.GitReferenceCurrent, + GitReferenceNext = string.IsNullOrEmpty(repository.GitReferenceNext) ? "main" : repository.GitReferenceNext, + GitReferenceEdge = string.IsNullOrEmpty(repository.GitReferenceEdge) ? "main" : repository.GitReferenceEdge, + }; if (string.IsNullOrEmpty(repository.Origin)) { if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("GITHUB_ACTIONS")))