Problem
react-doctor webapp --scope changed can fail inside a Git hook:
ENOENT: no such file or directory, open '<repo>/webapp/ops/maintenance/index.html'
Git hooks export GIT_DIR. React Doctor passes it to nested Git commands, which then ignore the scoped cwd and return repository-root paths.
Expected
A scan scoped to webapp/ returns paths relative to webapp/ and ignores files outside it.
Fix
Clear GIT_DIR for nested Git commands while preserving GIT_INDEX_FILE and the rest of the environment.
I have a tested patch with a linked-worktree regression case.
Problem
react-doctor webapp --scope changedcan fail inside a Git hook:Git hooks export
GIT_DIR. React Doctor passes it to nested Git commands, which then ignore the scopedcwdand return repository-root paths.Expected
A scan scoped to
webapp/returns paths relative towebapp/and ignores files outside it.Fix
Clear
GIT_DIRfor nested Git commands while preservingGIT_INDEX_FILEand the rest of the environment.I have a tested patch with a linked-worktree regression case.