Skip to content
Discussion options

You must be logged in to vote

That diagnosis is correct. Git starts a non-bare hook at the worktree root, where GIT_DIR without GIT_WORK_TREE is valid. hk then runs the scoped step from src/, so nested Git commands treat that directory as the worktree root and misalign the index paths.

I opened #1200 to fix this in hk. It makes the resolved worktree root explicit as GIT_WORK_TREE while preserving GIT_INDEX_FILE, since that can identify the temporary index actually being committed. The regression test exercises a real commit from a linked worktree with the step scoped to a subdirectory, in both libgit2 modes.

Thanks for tracking down the full-hook diagnostic, and sorry for the earlier misdiagnoses.

AI-assisted — Tool: …

Replies: 1 comment 8 replies

Comment options

jdx
Jul 31, 2026 — with coder-jdx
Maintainer

You must be logged in to vote
8 replies
@antikhv
Comment options

@antikhv
Comment options

@antikhv
Comment options

@jdxcoder-jdx
Comment options

jdx Aug 14, 2026 — with coder-jdx
Maintainer

Answer selected by antikhv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants