mirror of
https://github.com/ultraworkers/claw-code.git
synced 2026-04-24 13:08:11 +08:00
Problem: In git worktrees, .git is a pointer file (not a directory), so cargo's rerun-if-changed=.git/HEAD never triggers when commits are made. This causes claw version to report a stale SHA after new commits. Solution: Add resolve_git_head_path() helper that detects worktree mode: - If .git is a file: parse gitdir pointer, watch <gitdir>/HEAD - If .git is a directory: watch .git/HEAD (regular repo) This ensures build.rs invalidates on each commit, making version output truthful. Verification: Binary built in worktree now reports correct SHA after commits (before: stale, after: current HEAD). Relates to ROADMAP #161 (filed cycle #65, implemented cycle #69). Diagnostic-strictness family member. Diff: 21 lines added (resolve_git_head_path + conditional rerun-if-changed).