ReviewOS

stacks/gitlint

fix: resolve Git paths in linked worktrees

#550
Closed chris opened this 9 days ago ·
9 days ago

Problem

Gitlint and its hook installer assume .git is a directory. In a standard linked Git worktree, .git is a pointer file. A configured hook such as gitlint --edit .git/COMMIT_EDITMSG therefore resolves to an invalid path and blocks otherwise valid commits with ENOTDIR.

The hook installer also joins <worktree>/.git/hooks, which cannot locate the repository's effective hooks directory in a linked worktree.

Acceptance criteria

  • --edit .git/COMMIT_EDITMSG resolves through git rev-parse --git-path when .git is a pointer file.
  • Ordinary absolute and relative commit-message paths remain unchanged.
  • Hook installation and removal use Git's resolved hooks directory.
  • Tests exercise a real linked worktree rather than mocking the path layout.
  • A patch release is published and downstream Stacks consumes it.

Sign in to comment on this issue.