fix: mirror sync files before commit

This commit is contained in:
2026-05-15 03:09:54 +00:00
parent 684c35bc00
commit c70a818986
2 changed files with 23 additions and 9 deletions
+5 -4
View File
@@ -101,7 +101,7 @@ describe('commitAndPush', () => {
assert.ok(!addCall.args.includes('README.md'));
});
it('does not add missing sync paths', async () => {
it('removes missing sync paths from the repo copy', async () => {
const missingPath = path.join(workspace, '.amazonq/rules/triage-findings.md');
fs.rmSync(missingPath, { force: true });
fs.rmSync(path.join(workspace, 'repo', '.amazonq/rules/triage-findings.md'), { force: true });
@@ -109,9 +109,10 @@ describe('commitAndPush', () => {
await commitAndPush(workspace, path.join(workspace, 'repo'), spawn);
const addCall = spawn.calls.find(c => c.args[0] === 'add');
assert.ok(addCall, 'expected git add to run');
assert.ok(!addCall.args.includes('.amazonq/rules/triage-findings.md'));
const rmCall = spawn.calls.find(c => c.args[0] === 'rm');
assert.ok(rmCall, 'expected git rm to run');
assert.ok(rmCall.args.includes('.amazonq/rules/triage-findings.md'));
assert.equal(fs.existsSync(path.join(workspace, 'repo', '.amazonq/rules/triage-findings.md')), false);
});
it('overwrites existing repo copies with workspace files', async () => {