fix: scope conflict confirmation to agent changes
This commit is contained in:
1 parent
54fc6ee494
commit
eb67012e82
2 files changed
+29
-1
No files matched your search
@@ -2,6 +2,7 @@ import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import {
|
||||
buildConflictPushArgs,
|
||||
buildConflictReviewDiffArgs,
|
||||
canAutoResolveConflicts,
|
||||
describeConflictResolutionFailure,
|
||||
diffSnapshotInventories
|
||||
@@ -33,6 +34,20 @@ test("only a passing conflicted writable current head is eligible", () => {
|
||||
assert.equal(canAutoResolveConflicts({ ...eligible, enabled: false }), false);
|
||||
});
|
||||
|
||||
test("conflict final review scopes the diff to agent-changed files", () => {
|
||||
assert.deepEqual(buildConflictReviewDiffArgs(["server.js", "public/js/app.js"]), [
|
||||
"diff",
|
||||
"--cached",
|
||||
"--no-ext-diff",
|
||||
"--unified=80",
|
||||
"--",
|
||||
"server.js",
|
||||
"public/js/app.js"
|
||||
]);
|
||||
assert.throws(() => buildConflictReviewDiffArgs([]), /at least one agent-changed file/);
|
||||
assert.throws(() => buildConflictReviewDiffArgs([".env"]), /protected path/);
|
||||
});
|
||||
|
||||
test("conflict failures are actionable without exposing raw command output", () => {
|
||||
assert.match(
|
||||
describeConflictResolutionFailure(new Error("fatal: refusing to merge unrelated histories")),
|
||||
|
||||
Reference in new issue
Block a user