Git CLI worktree paths — EARS
Parent LLD: ./LLD.md
Status: Implemented — exercised by tests/cli/test_git.py (TestResolveGitPaths, TestHooks, TestCompose).
Repository discovery
-
[x] GIT-PATH-001: When the user invokes
llamabot git hooksorllamabot git composefrom any subdirectory of a git work tree, the system shall resolve the enclosing repository's git directories without requiring the user to be at the repository root. -
[x] GIT-PATH-002: When the user invokes either command outside a git work tree, the system shall raise a
RuntimeErrorwhose message instructs the user to run it inside a git repository.
Linked worktrees
-
[x] GIT-PATH-003: When
llamabot git hooksruns inside a linked worktree, the system shall installprepare-commit-msginto the shared hooks directory of the common git dir, such that the hook is active for the main checkout and all linked worktrees. -
[x] GIT-PATH-004: When
llamabot git composeruns inside a linked worktree, the system shall write the composed commit message to theCOMMIT_EDITMSGfile of the worktree-local admin directory. -
[x] GIT-PATH-005: While
.gitis a file rather than a directory (the linked-worktree marker), the system shall complete both commands without raisingNotADirectoryError.
Plain checkouts (regression)
- [x] GIT-PATH-006: When either command runs in a plain (non-worktree) repository root, the system shall behave identically to the previous release: hook at
.git/hooks/prepare-commit-msg, commit message at.git/COMMIT_EDITMSG.