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

Function makeRepo

__tests__/git-ignored-dirs-scope.test.ts:43–49  ·  view source on GitHub ↗

A repo at `dir` with `tracked` committed, then `untracked` written for `.gitignore` to hide.

(dir: string, tracked: Record<string, string>, untracked: Record<string, string> = {})

Source from the content-addressed store, hash-verified

41
42/** A repo at `dir` with `tracked` committed, then `untracked` written for `.gitignore` to hide. */
43function makeRepo(dir: string, tracked: Record<string, string>, untracked: Record<string, string> = {}): void {
44 for (const [rel, content] of Object.entries(tracked)) write(path.join(dir, rel), content);
45 git(dir, 'init', '-q');
46 git(dir, 'add', '-A');
47 git(dir, '-c', 'user.email=t@t', '-c', 'user.name=t', 'commit', '-qm', 'init');
48 for (const [rel, content] of Object.entries(untracked)) write(path.join(dir, rel), content);
49}
50
51/** What git reports as ignored-untracked, relative to `cwd`. */
52function gitIgnored(cwd: string): string[] {

Callers 1

Calls 3

writeFunction · 0.70
gitFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected