Skip to content

Commit 78b10dc

Browse files
vishvanandaVishvananda Abrams
andauthored
Skip pre-commit hooks for shadow repo (#13331) (#13488)
Co-authored-by: Vishvananda Abrams <[email protected]>
1 parent 85bc25a commit 78b10dc

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

packages/core/src/services/gitService.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,15 @@ describe('GitService', () => {
245245
expect(hoistedMockCommit).not.toHaveBeenCalled();
246246
});
247247
});
248+
249+
describe('createFileSnapshot', () => {
250+
it('should commit with --no-verify flag', async () => {
251+
const service = new GitService(projectRoot, storage);
252+
await service.initialize();
253+
await service.createFileSnapshot('test commit');
254+
expect(hoistedMockCommit).toHaveBeenCalledWith('test commit', {
255+
'--no-verify': null,
256+
});
257+
});
258+
});
248259
});

packages/core/src/services/gitService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ export class GitService {
112112
try {
113113
const repo = this.shadowGitRepository;
114114
await repo.add('.');
115-
const commitResult = await repo.commit(message);
115+
const commitResult = await repo.commit(message, {
116+
'--no-verify': null,
117+
});
116118
return commitResult.commit;
117119
} catch (error) {
118120
throw new Error(

0 commit comments

Comments
 (0)