style: sync paired workspace sparse formatting
This commit is contained in:
@@ -329,7 +329,10 @@ describe('paired workspace manager', () => {
|
|||||||
runGit(['init'], canonicalDir);
|
runGit(['init'], canonicalDir);
|
||||||
runGit(['config', 'user.email', 'test@example.com'], canonicalDir);
|
runGit(['config', 'user.email', 'test@example.com'], canonicalDir);
|
||||||
runGit(['config', 'user.name', 'EJClaw Test'], canonicalDir);
|
runGit(['config', 'user.name', 'EJClaw Test'], canonicalDir);
|
||||||
fs.writeFileSync(path.join(canonicalDir, 'tracked.ts'), 'export const ok = 1;\n');
|
fs.writeFileSync(
|
||||||
|
path.join(canonicalDir, 'tracked.ts'),
|
||||||
|
'export const ok = 1;\n',
|
||||||
|
);
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
path.join(canonicalDir, '.claude', 'settings.json'),
|
path.join(canonicalDir, '.claude', 'settings.json'),
|
||||||
'{"secret":true}\n',
|
'{"secret":true}\n',
|
||||||
@@ -340,7 +343,13 @@ describe('paired workspace manager', () => {
|
|||||||
);
|
);
|
||||||
fs.writeFileSync(path.join(canonicalDir, '.env.example'), 'EXAMPLE=1\n');
|
fs.writeFileSync(path.join(canonicalDir, '.env.example'), 'EXAMPLE=1\n');
|
||||||
runGit(
|
runGit(
|
||||||
['add', 'tracked.ts', '.claude/settings.json', '.env.production', '.env.example'],
|
[
|
||||||
|
'add',
|
||||||
|
'tracked.ts',
|
||||||
|
'.claude/settings.json',
|
||||||
|
'.env.production',
|
||||||
|
'.env.example',
|
||||||
|
],
|
||||||
canonicalDir,
|
canonicalDir,
|
||||||
);
|
);
|
||||||
runGit(['commit', '-m', 'initial'], canonicalDir);
|
runGit(['commit', '-m', 'initial'], canonicalDir);
|
||||||
@@ -371,9 +380,9 @@ describe('paired workspace manager', () => {
|
|||||||
const reviewerWorkspace =
|
const reviewerWorkspace =
|
||||||
manager.refreshReviewerSnapshotForPairedTask('paired-task-4');
|
manager.refreshReviewerSnapshotForPairedTask('paired-task-4');
|
||||||
|
|
||||||
expect(
|
expect(runGit(['status', '--short'], reviewerWorkspace.workspace_dir)).toBe(
|
||||||
runGit(['status', '--short'], reviewerWorkspace.workspace_dir),
|
'',
|
||||||
).toBe('');
|
);
|
||||||
expect(
|
expect(
|
||||||
fs.existsSync(
|
fs.existsSync(
|
||||||
path.join(reviewerWorkspace.workspace_dir, '.claude', 'settings.json'),
|
path.join(reviewerWorkspace.workspace_dir, '.claude', 'settings.json'),
|
||||||
|
|||||||
@@ -92,11 +92,7 @@ function runGit(args: string[], cwd?: string): string {
|
|||||||
}).trim();
|
}).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
function runGitWithInput(
|
function runGitWithInput(args: string[], cwd: string, input: string): string {
|
||||||
args: string[],
|
|
||||||
cwd: string,
|
|
||||||
input: string,
|
|
||||||
): string {
|
|
||||||
return execFileSync('git', args, {
|
return execFileSync('git', args, {
|
||||||
cwd,
|
cwd,
|
||||||
input,
|
input,
|
||||||
@@ -181,11 +177,9 @@ function shouldIncludeUntrackedReviewerPath(relativePath: string): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function listAllowedTrackedFiles(sourceDir: string): string[] {
|
function listAllowedTrackedFiles(sourceDir: string): string[] {
|
||||||
return listGitPaths(sourceDir, [
|
return listGitPaths(sourceDir, ['ls-files', '--cached', '-z']).filter(
|
||||||
'ls-files',
|
(relativePath) => !isReviewerSnapshotDeniedPath(relativePath),
|
||||||
'--cached',
|
);
|
||||||
'-z',
|
|
||||||
]).filter((relativePath) => !isReviewerSnapshotDeniedPath(relativePath));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function listDeletedTrackedFiles(sourceDir: string): string[] {
|
function listDeletedTrackedFiles(sourceDir: string): string[] {
|
||||||
@@ -356,8 +350,12 @@ export function refreshReviewerSnapshotForPairedTask(
|
|||||||
runGit(['clone', '--shared', ownerWorkspace.workspace_dir, reviewerDir]);
|
runGit(['clone', '--shared', ownerWorkspace.workspace_dir, reviewerDir]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const allowedTrackedFiles = listAllowedTrackedFiles(ownerWorkspace.workspace_dir);
|
const allowedTrackedFiles = listAllowedTrackedFiles(
|
||||||
const deletedTrackedFiles = listDeletedTrackedFiles(ownerWorkspace.workspace_dir);
|
ownerWorkspace.workspace_dir,
|
||||||
|
);
|
||||||
|
const deletedTrackedFiles = listDeletedTrackedFiles(
|
||||||
|
ownerWorkspace.workspace_dir,
|
||||||
|
);
|
||||||
const allowedUntrackedFiles = listAllowedUntrackedFiles(
|
const allowedUntrackedFiles = listAllowedUntrackedFiles(
|
||||||
ownerWorkspace.workspace_dir,
|
ownerWorkspace.workspace_dir,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user