Repository navigation
fix(skills): support git before 2.31 in the worktree hook scripts - #600
Conversation
`git rev-parse --path-format=absolute` does not exist before git 2.31. In refuse-main-checkout.sh that failure, under set -e, failed the pre-commit hook everywhere, worktrees included, so --no-verify became the only way to commit. In worktree-remove.sh it exited 0 and silently left every worktree in place. Both now resolve paths physically with cd + pwd -P. Measured with a git shim that rejects --path-format: the guard refuses in the primary checkout and commits in a worktree, a worktree subdirectory, and under CI; the remove hook removes the worktree and its merged branch. Ported from taskless/taskless#420, where the cloud repo's review found it.
|
@claude /review |
|
Claude finished @theCodeDrift's task in 1m 24s —— View job Review complete ✅Review mode: incremental — read 0 prior review thread(s) before reviewing.
AssessmentBoth fixes are correct and narrowly scoped.
No test harness exists for these hook scripts (checked Checked No correctness, security, or clarity issues found. |
Thanks. No findings, so nothing changed; merging once green. — AI Coding Agent |
git rev-parse --path-format=absolutedoes not exist before git 2.31, and two worktree hook scripts depended on it.refuse-main-checkout.sh(from chore: refuse commits in the primary checkout #599): underset -ethe unknown option failed thepre-commithook everywhere, worktrees included, so--no-verify, which agents are told never to use, became the only way to commit.worktree-remove.sh: the failure exited 0, so on old git every worktree was silently left in place.Both now resolve paths physically (
cd … && pwd -P). The remove hook resolves--git-common-dirfrom inside the worktree, since it can print a relative path.Measured with a
gitshim that rejects--path-format, through the real Husky runner:CI=trueWorktreeRemovepayloadPorted from the cloud repo's fix in taskless/taskless#420, whose review found it. No changeset: repo tooling, nothing ships.