From: Eduardo San Martin Morote Date: Mon, 30 Mar 2026 13:27:10 +0000 (+0200) Subject: build: support git worktrees in verifyCommit script X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;p=thirdparty%2Fvuejs%2Frouter.git build: support git worktrees in verifyCommit script --- diff --git a/scripts/verifyCommit.mjs b/scripts/verifyCommit.mjs index 6c1bcb3ab..3fe405848 100644 --- a/scripts/verifyCommit.mjs +++ b/scripts/verifyCommit.mjs @@ -1,10 +1,12 @@ // Invoked on the commit-msg git hook by simple-git-hooks. import chalk from 'chalk' +import { execSync } from 'node:child_process' import { readFileSync } from 'node:fs' import path from 'node:path' -const msgPath = path.resolve('.git/COMMIT_EDITMSG') +const gitDir = execSync('git rev-parse --git-dir', { encoding: 'utf-8' }).trim() +const msgPath = path.resolve(gitDir, 'COMMIT_EDITMSG') const msg = readFileSync(msgPath, 'utf-8').trim() const commitRE =