Merge claudedo/f319b602707f4dfdb6727e9fae5ac757

This commit is contained in:
mika kuns
2026-08-10 14:58:58 +02:00
6 changed files with 335 additions and 6 deletions
@@ -492,6 +492,24 @@ public sealed class TaskMergeService
await _git.AddPathAsync(list.WorkingDir, path, ct);
}
/// <summary>
/// Writes a conflicted file's content without staging it. Unlike <see cref="WriteResolutionAsync"/> this must
/// NOT run `git add` — that marks the path resolved in git's index regardless of its content, so a partially
/// resolved hunk (markers still present elsewhere in the file) would drop out of
/// <see cref="GetConflictDocumentsAsync"/>'s conflicted-file list and <see cref="ContinueMergeAsync"/>'s
/// pre-stage marker scan, letting a still-conflicted file slip into a commit. Staging happens once, for
/// everything, inside <see cref="ContinueMergeAsync"/>.
/// </summary>
public async Task WriteConflictFileAsync(string taskId, string path, string content, CancellationToken ct)
{
var (_, list, _, _) = await LoadMergeContextAsync(taskId, ct);
if (string.IsNullOrWhiteSpace(list.WorkingDir))
throw new InvalidOperationException("list has no working directory");
var full = Path.Combine(list.WorkingDir, path.Replace('/', Path.DirectorySeparatorChar));
await File.WriteAllTextAsync(full, content, ct);
}
public async Task<MergeTargets> GetTargetsAsync(string taskId, CancellationToken ct)
{
var (_, list, _, _) = await LoadMergeContextAsync(taskId, ct);