mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-16 21:31:58 +01:00
fix(pregate): clear --run reads origin before url.insteadOf, so Capy's git.capy.ai proxy still names the GitHub repository
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
cc22404d35
commit
97d387c04d
3 files changed
+16
-2
No files matched your search
@@ -209,6 +209,19 @@ describe.skipIf(process.platform === 'win32')('clear --run: Actions runs as remo
|
||||
expect(verifyPregate(repo.work, forged, { tree: file.tree } as any)).toMatchObject({ ok: false, code: 'PREGATE_REMOTE_UNCLEARED' });
|
||||
}, 120_000);
|
||||
|
||||
test('origin is read before url.insteadOf, so a Capy git.capy.ai proxy still names the GitHub repository', async () => {
|
||||
const repo = fixture();
|
||||
const file = await pregateAt(repo);
|
||||
fs.mkdirSync(path.join(repo.work, '.gstack/tmp'), { recursive: true });
|
||||
fs.writeFileSync(path.join(repo.work, '.gstack/tmp/pregate.json'), JSON.stringify(file));
|
||||
repo.git('remote', 'set-url', 'origin', 'https://github.com/fx/fx.git');
|
||||
repo.git('config', 'url.https://git.capy.ai/.insteadOf', 'https://github.com/');
|
||||
expect(repo.git('remote', 'get-url', 'origin')).toBe('https://git.capy.ai/fx/fx.git');
|
||||
const r = runBin(repo, 'gstack-pregate', ['clear', '--remote', LANE, '--run', '200', '--run', '201', '--allow-repo-commands']);
|
||||
expect(r.err).not.toContain('origin is not a github.com repository');
|
||||
expect([r.status, r.err]).toEqual([EXIT.usage, expect.stringContaining('declares remote_gate_runs')]);
|
||||
}, 120_000);
|
||||
|
||||
test('the bin refuses --run when the base declares no run profiles, and keeps the --receipt route unchanged', async () => {
|
||||
const repo = fixture();
|
||||
const file = await pregateAt(repo);
|
||||
|
||||
Reference in new issue
Block a user