MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / makeRepo

Function makeRepo

__tests__/extraction.test.ts:8939–8949  ·  view source on GitHub ↗
(dir: string, base: string)

Source from the content-addressed store, hash-verified

8937 let tempDir: string;
8938 // Helper: make a self-contained git repo at `dir` with one committed TS file.
8939 const makeRepo = async (dir: string, base: string) => {
8940 const { execFileSync } = await import('child_process');
8941 const git = (...args: string[]) => execFileSync('git', args, { cwd: dir, stdio: 'pipe' });
8942 fs.mkdirSync(dir, { recursive: true });
8943 git('init', '-q');
8944 git('config', 'user.email', 'test@test.com');
8945 git('config', 'user.name', 'Test');
8946 fs.writeFileSync(path.join(dir, `${base}.ts`), `export const ${base} = 1;`);
8947 git('add', '-A');
8948 git('commit', '-q', '-m', `${base} init`);
8949 };
8950
8951 beforeEach(() => {
8952 tempDir = createTempDir();

Callers 1

extraction.test.tsFile · 0.70

Calls 2

gitFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected