Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 16, 2025

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 .git directory 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 getNestedGitRepository method in ShadowCheckpointService.ts to:

  1. Check if the workspace root has its own .git directory first
  2. If the root has NO .git, allow checkpoints since subdirectory git repos are independent projects (not truly nested)
  3. Only block checkpoints when the root HAS a .git AND there are nested .git directories (true nesting scenario like git submodules)

The subdirectory .git folders are already excluded from tracking via the existing .git/ pattern in the exclude patterns.

Test Procedure

  1. Unit Tests: Added a new test case succeeds when workspace root has no .git but subdirectories have git repos (sibling projects) that verifies:

    • A workspace without root .git but with subdirectory git repos can initialize checkpoints
    • Checkpoints can be saved and restored correctly in this scenario
  2. Manual Testing Steps:

    • Create a parent folder without git initialization
    • Create two subdirectories (e.g., frontend and backend)
    • Initialize git in each subdirectory separately
    • Open the parent folder in VS Code with Roo Code
    • Enable checkpoints - should now work without the nested git error
  3. All existing tests pass: 32/32 tests passing

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - This is a backend logic change with no UI impact.

Documentation Updates

  • No documentation updates are required.

Additional Notes

Feedback and guidance are welcome. This fix maintains backward compatibility:

  • Projects with root .git and nested repos (like git submodules) still see the error
  • Projects without root .git can now use checkpoints regardless of subdirectory git repos

Get in Touch

@roomote

…ve git repos

This fixes 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 previous behavior blocked checkpoints whenever any nested .git
directory was detected. This change modifies the detection logic to:

1. Check if the workspace root has its own .git directory first
2. If the root has NO .git, allow checkpoints since subdirectory git
   repos are independent projects (not truly nested)
3. Only block checkpoints when the root HAS a .git AND there are nested
   .git directories (true nesting scenario like git submodules)

The subdirectory .git folders are already excluded from tracking via
the existing .git/ pattern in the exclude patterns.

Closes #10125
@roomote
Copy link
Contributor Author

roomote bot commented Dec 16, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The fix correctly distinguishes between:

  • True nested git repos (root has .git + subdirs have nested .git) - blocked as before
  • Sibling independent projects (root has no .git but subdirs have their own repos) - now allowed

The implementation is clean, well-tested, and backward compatible.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

无法开启存档点

3 participants