fix(worker): stage only resolved conflict paths in continue_merge
git add -A ran against the shared target checkout, sweeping in whatever untracked or unrelated modified files a concurrent session left there and committing them into an unrelated merge. Stage exactly the paths that were reported conflicted and resolved instead.
This commit is contained in:
@@ -315,7 +315,11 @@ public sealed class TaskMergeService
|
||||
if (stillConflicted.Count > 0)
|
||||
return new MergeResult(StatusConflict, stillConflicted, "conflicts not fully resolved");
|
||||
|
||||
await _git.AddAllAsync(list.WorkingDir, ct);
|
||||
// Stage exactly the resolved conflict paths — never `git add -A`, which would sweep
|
||||
// untracked/unrelated changes left by other sessions into this merge commit (the
|
||||
// target working dir is shared).
|
||||
foreach (var path in unresolved)
|
||||
await _git.AddPathAsync(list.WorkingDir, path, ct);
|
||||
|
||||
var remaining = await _git.ListConflictedFilesAsync(list.WorkingDir, ct);
|
||||
if (remaining.Count > 0)
|
||||
|
||||
Reference in New Issue
Block a user