fix: prepare complete history for conflict repair
This commit is contained in:
1 parent
0e914c6bc6
commit
c2f39d452b
6 files changed
+78
-8
No files matched your search
@@ -3,6 +3,7 @@ import test from "node:test";
|
||||
import {
|
||||
buildConflictPushArgs,
|
||||
canAutoResolveConflicts,
|
||||
describeConflictResolutionFailure,
|
||||
diffSnapshotInventories
|
||||
} from "../src/review/conflictResolver.js";
|
||||
|
||||
@@ -32,6 +33,25 @@ test("only a passing conflicted writable current head is eligible", () => {
|
||||
assert.equal(canAutoResolveConflicts({ ...eligible, enabled: false }), false);
|
||||
});
|
||||
|
||||
test("conflict failures are actionable without exposing raw command output", () => {
|
||||
assert.match(
|
||||
describeConflictResolutionFailure(new Error("fatal: refusing to merge unrelated histories")),
|
||||
/did not contain enough Git history/
|
||||
);
|
||||
assert.match(
|
||||
describeConflictResolutionFailure(new Error("remote: Write access to repository not granted")),
|
||||
/Allow edits from maintainers/
|
||||
);
|
||||
assert.match(
|
||||
describeConflictResolutionFailure(new Error("rejected: stale info")),
|
||||
/Run \/conflict again/
|
||||
);
|
||||
assert.doesNotMatch(
|
||||
describeConflictResolutionFailure(new Error("secret-token-value")),
|
||||
/secret-token-value/
|
||||
);
|
||||
});
|
||||
|
||||
test("external fork conflict pushes use a head-SHA force lease", () => {
|
||||
assert.deepEqual(buildConflictPushArgs({
|
||||
baseRepository: "forumlify/public",
|
||||
|
||||
Reference in new issue
Block a user