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

Function addBareGitlink

__tests__/worktree-detection.test.ts:311–324  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

309 }
310
311 function addBareGitlink(name: string): string {
312 const dir = path.join(parent, name);
313 fs.mkdirSync(dir);
314 git(dir, 'init', '-q');
315 git(dir, 'config', 'user.email', 'test@example.com');
316 git(dir, 'config', 'user.name', 'Test');
317 git(dir, 'config', 'commit.gpgsign', 'false');
318 fs.writeFileSync(path.join(dir, 'tool.ts'), 'export const y = 2;\n');
319 git(dir, 'add', '.');
320 git(dir, 'commit', '-q', '-m', 'tool');
321 git(parent, 'add', name); // records a 160000 gitlink, no .gitmodules
322 git(parent, 'commit', '-q', '-m', 'gitlink');
323 return dir;
324 }
325
326 it('does NOT flag an active submodule covered by the parent index', () => {
327 const sub = addSubmodule('service-a');

Callers 1

Calls 2

gitFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected