Skip pre-commit hooks for shadow repo (#13331) (#13488)

Co-authored-by: Vishvananda Abrams <vabrams@google.com>
This commit is contained in:
Vish (Ishaya) Abrams
2025-11-20 14:50:36 -08:00
committed by GitHub
parent 85bc25a765
commit 78b10dccf1
2 changed files with 14 additions and 1 deletions

View File

@@ -245,4 +245,15 @@ describe('GitService', () => {
expect(hoistedMockCommit).not.toHaveBeenCalled();
});
});
describe('createFileSnapshot', () => {
it('should commit with --no-verify flag', async () => {
const service = new GitService(projectRoot, storage);
await service.initialize();
await service.createFileSnapshot('test commit');
expect(hoistedMockCommit).toHaveBeenCalledWith('test commit', {
'--no-verify': null,
});
});
});
});

View File

@@ -112,7 +112,9 @@ export class GitService {
try {
const repo = this.shadowGitRepository;
await repo.add('.');
const commitResult = await repo.commit(message);
const commitResult = await repo.commit(message, {
'--no-verify': null,
});
return commitResult.commit;
} catch (error) {
throw new Error(