diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts index 7f55240fa31f9b..459e4b99445a7f 100644 --- a/lib/util/git/index.spec.ts +++ b/lib/util/git/index.spec.ts @@ -1056,30 +1056,4 @@ describe('util/git/index', () => { expect(sha).toBe(git.getBranchCommit(defaultBranch)); }); }); - - describe('installHook()', () => { - it('installHook()', async () => { - //git.getCommitMessages() only returns the first line (i.e. subject) of each msg - await git.installHook( - 'commit-msg', - '#!/bin/sh\necho "APPENDED FROM COMMIT-MSG HOOK" >> $1;' - ); - const files: FileChange[] = [ - { - type: 'addition', - path: 'some-new-file', - contents: 'some new-contents', - }, - ]; - setNoVerify(['push']); - await git.commitFiles({ - branchName: 'renovate/something', - files, - message: 'Orig-commit-msg', - }); - - const messages = await git.getCommitMessages(); - expect(messages[0]).toBe('Orig-commit-msg APPENDED FROM COMMIT-MSG HOOK'); - }); - }); }); diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 95fb7c10804f55..4698779d97765c 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -249,17 +249,6 @@ export async function initRepo(args: StorageConfig): Promise { await fetchBranchCommits(); } -export async function installHook( - name: string, - hookSource: string -): Promise { - await syncGit(); - const localDir = GlobalConfig.get('localDir')!; - const gitHooks = upath.join(localDir, '.git/hooks'); - await fs.writeFile(`${gitHooks}/${name}`, hookSource); - await fs.chmod(`${gitHooks}/${name}`, 0o500); -} - async function resetToBranch(branchName: string): Promise { logger.debug(`resetToBranch(${branchName})`); await git.raw(['reset', '--hard']);