MCPcopy Create free account
hub / github.com/garrytan/gstack / setupGstackRepo

Function setupGstackRepo

test/gstack-gbrain-source-wireup.test.ts:142–152  ·  view source on GitHub ↗
(remoteUrl: string)

Source from the content-addressed store, hash-verified

140}
141
142function setupGstackRepo(remoteUrl: string) {
143 // Real git repo at gstackHome with at least one commit + an origin remote.
144 fs.mkdirSync(gstackHome, { recursive: true });
145 spawnSync('git', ['-C', gstackHome, 'init', '-q', '-b', 'main'], { stdio: 'pipe' });
146 spawnSync('git', ['-C', gstackHome, 'config', 'user.email', 'test@example.com'], { stdio: 'pipe' });
147 spawnSync('git', ['-C', gstackHome, 'config', 'user.name', 'test'], { stdio: 'pipe' });
148 fs.writeFileSync(path.join(gstackHome, '.brain-allowlist'), '# allowlist\n');
149 spawnSync('git', ['-C', gstackHome, 'add', '.'], { stdio: 'pipe' });
150 spawnSync('git', ['-C', gstackHome, 'commit', '-q', '-m', 'init'], { stdio: 'pipe' });
151 spawnSync('git', ['-C', gstackHome, 'remote', 'add', 'origin', remoteUrl], { stdio: 'pipe' });
152}
153
154beforeEach(() => {
155 tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-wireup-test-'));

Calls 1

spawnSyncFunction · 0.85

Tested by

no test coverage detected