Skip to content

Commit 3ad7c8f

Browse files
CopilotJusterZhu
andauthored
Fix Differential delete-list serialization without reflection (#179)
* Initial plan * fix differential delete list serialization Agent-Logs-Url: https://github.com/GeneralLibrary/GeneralUpdate/sessions/92ef0ef0-21f5-4118-9814-9846e31c2bb0 Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
1 parent 0619a30 commit 3ad7c8f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/c#/DifferentialTest/DifferentialTest.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>
8+
<JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
89
</PropertyGroup>
910

1011
<ItemGroup>
@@ -23,4 +24,4 @@
2324
<ProjectReference Include="..\GeneralUpdate.Differential\GeneralUpdate.Differential.csproj" />
2425
</ItemGroup>
2526

26-
</Project>
27+
</Project>

src/c#/GeneralUpdate.Differential/Matchers/DefaultCleanStrategy.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Linq;
33
using System.Threading.Tasks;
44
using GeneralUpdate.Common.FileBasic;
5+
using GeneralUpdate.Common.Internal.JsonContext;
56
using GeneralUpdate.Differential.Binary;
67

78
namespace GeneralUpdate.Differential.Matchers
@@ -56,11 +57,11 @@ public async Task ExecuteAsync(string sourcePath, string targetPath, string patc
5657
}
5758
}
5859

59-
var exceptFiles = _matcher.Except(sourcePath, targetPath);
60+
var exceptFiles = _matcher.Except(sourcePath, targetPath)?.ToList();
6061
if (exceptFiles is not null && exceptFiles.Any())
6162
{
6263
var path = Path.Combine(patchPath, DeleteFilesName);
63-
StorageManager.CreateJson(path, exceptFiles);
64+
StorageManager.CreateJson(path, exceptFiles, FileNodesJsonContext.Default.ListFileNode);
6465
}
6566
}
6667

0 commit comments

Comments
 (0)