fix: allow checkpoints when workspace root has no .git but subdirs have git repos #10130
+77
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #10125
Roo Code Task Context (Optional)
N/A
Description
This PR attempts to address Issue #10125 where users could not enable checkpoints when opening a parent folder containing multiple sibling projects (e.g., frontend and backend), each with their own git repositories.
The Problem:
The previous behavior blocked checkpoints whenever any nested
.gitdirectory was detected, even when the parent folder itself had no.git. This prevented a common workflow where developers open a parent folder to work across multiple independent projects.The Solution:
Modified the
getNestedGitRepositorymethod inShadowCheckpointService.tsto:.gitdirectory first.git, allow checkpoints since subdirectory git repos are independent projects (not truly nested).gitAND there are nested.gitdirectories (true nesting scenario like git submodules)The subdirectory
.gitfolders are already excluded from tracking via the existing.git/pattern in the exclude patterns.Test Procedure
Unit Tests: Added a new test case
succeeds when workspace root has no .git but subdirectories have git repos (sibling projects)that verifies:.gitbut with subdirectory git repos can initialize checkpointsManual Testing Steps:
frontendandbackend)All existing tests pass: 32/32 tests passing
Pre-Submission Checklist
Screenshots / Videos
N/A - This is a backend logic change with no UI impact.
Documentation Updates
Additional Notes
Feedback and guidance are welcome. This fix maintains backward compatibility:
.gitand nested repos (like git submodules) still see the error.gitcan now use checkpoints regardless of subdirectory git reposGet in Touch
@roomote