You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(checkpoints): isolate shadow repo operations from
GIT_DIR environment
Fixes issue where checkpoint commits were written to the
wrong repository
when GIT_DIR environment variable was set in Dev
Containers.
Problem:
When developers use VS Code Dev Containers with remoteEnv
setting GIT_DIR,
Roo's checkpoint commits would land in the GIT_DIR location
instead of the
shadow repository, causing unintended commits and
confusion.
Root cause:
The simple-git library inherits the parent process
environment, and git
gives precedence to GIT_DIR over local .git directories.
Even though the
shadow repo was correctly initialized with core.worktree,
the inherited
GIT_DIR environment variable overrode repository detection.
Solution:
- Created createSanitizedGit() function that explicitly
unsets git-related
environment variables (GIT_DIR, GIT_WORK_TREE,
GIT_INDEX_FILE, etc.)
before creating SimpleGit instances for checkpoint
operations
- Applied sanitization at both shadow repo creation and
cleanup operations
- Added logging to help debug environment issues in Dev
Containers
- Environment isolation is scoped only to checkpoint
operations, preserving
other workflows that may rely on GIT_DIR
Testing:
Added comprehensive test that simulates GIT_DIR scenario
and verifies:
- Commits don't leak to external repositories
- Checkpoint save/restore operations work correctly
- Environment state is properly cleaned up
0 commit comments