Skip to content

fix: Support git worktrees in pre-commit hook#15

Merged
sasjo merged 1 commit into
masterfrom
fix/support-git-worktree
May 13, 2026
Merged

fix: Support git worktrees in pre-commit hook#15
sasjo merged 1 commit into
masterfrom
fix/support-git-worktree

Conversation

@thced
Copy link
Copy Markdown
Contributor

@thced thced commented May 13, 2026

Git passes an absolute path to COMMIT_EDITMSG when committing from a worktree (e.g. .git/worktrees//COMMIT_EDITMSG), so the literal match against ".git/COMMIT_EDITMSG" failed and the path was forwarded to commitlint as an unknown positional argument. Match any path ending in COMMIT_EDITMSG instead.

Git passes an absolute path to COMMIT_EDITMSG when committing from a
worktree (e.g. .git/worktrees/<name>/COMMIT_EDITMSG), so the literal
match against ".git/COMMIT_EDITMSG" failed and the path was forwarded
to commitlint as an unknown positional argument. Match any path ending
in COMMIT_EDITMSG instead.
@thced thced requested a review from sasjo May 13, 2026 12:33
@sasjo sasjo merged commit 0449c5f into master May 13, 2026
1 check passed
@sasjo sasjo deleted the fix/support-git-worktree branch May 13, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants