GeezerVison is showing github.com — fix(server): a nested repository with no commits no longer breaks the review diff by Abhishek-B-R · Pull Request #28632 · pingdotgg/t3code
Conversation
Abhishek-B-R
commented
Nov 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
If a project contains an untracked nested repository with no commits yet (for example after running git init scaffold inside it), getReviewDiffPreview and the Changes totals fail, including for ordinary tracked changes.
To build the review, the server adds every untracked path to a temporary index with git add --intent-to-add. git ls-files --others lists the nested repository as scaffold/. What happens next depends on the Git version:
- Git 2.52 and older:
error: 'scaffold/' does not have a commit checked out, fatal: adding files failed, exit 128 from the add.
- Git 2.53 and newer (git/git 6fe288bfbcbb): the add succeeds and records a gitlink, then
git diff fails with fatal: cannot hash scaffold, exit 128.
Change
Before the add, each untracked path ending in / is asked for its HEAD with git rev-parse --verify --quiet HEAD, and the path is left out on exit 1. The nested repository stays out of the review until it has a commit. A nested repository with commits is still listed, and any other add failure is still reported.
--ignore-errors, which the first version of this PR used, is gone. It also skips ordinary files Git cannot index, such as one named git~1, which would leave them out of the diff with no sign the result was partial.
The real index is not touched, since this only runs against the disposable copy.
Scope and approval
No prior issue. This is a small fix for an obvious bug: one stray untracked folder should not take down the diff for every other file. It filters one list of paths before an existing Git invocation, and it adds no setting or new behaviour.
Verification
apps/server/src/vcs/GitVcsDriverCore.test.ts runs real Git against temporary repositories, with three tests:
keeps the review working beside a nested repository with no commits (diff and Changes totals)
keeps a nested repository with commits in the review
fails the review instead of leaving out an untracked file Git cannot index
Run from apps/server:
vp test run src/vcs/GitVcsDriverCore.test.ts -t "nested repository|untracked file Git cannot index"
- The first version of this PR on CI (Git 2.55.0): failed with
getReviewDiffPreview.stat, exit 128.
- This version on Git 2.51.2 and 2.50.1: all three pass.
- Git 2.53 and newer behaviour was simulated locally, by making Git 2.51.2 record the same intent-to-add gitlink. Without the fix that gives
fatal: cannot hash scaffold and the same error as CI. With the fix, all three pass.
- The
git~1 test on the first version: fails, because the file was silently left out.
vp run check:changed: format, lint, knip, graphql and typecheck pass. The test step has one failure, keeps generated worktree folders short without changing long branch names, which fails the same way without this change on my macOS machine (/var against /private/var in the temp path).
Not checked: real Git 2.55.0 locally (CI covers it), Windows, and the running app UI.
Claude Opus 5.5 via Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at bb68209
Macroscope's review found this PR approvable — Review diffs and Changes totals can now continue when an untracked nested repository has no commits. The change operates on a disposable index, leaves users' staging untouched, and retains fatal-error handling.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
prepareReviewIndex now checks untracked directory paths for a resolvable HEAD before adding them to the review index. A regression test checks review output and branch-change totals when the parent repository contains a nested repository with no commits.
Changes: Nested repository diff handling
| Layer / File(s) |
Summary |
Index preparation and preview test apps/server/src/vcs/GitVcsDriverCore.ts, apps/server/src/vcs/GitVcsDriverCore.test.ts |
prepareReviewIndex continues to exclude staged deletions. For untracked paths ending in /, it omits the path only when the HEAD check exits with code 1. The test checks that the parent review diff includes tracked and untracked changes and a committed sibling directory, excludes the nested scaffold repository contents, and reports baseRef: null, 3 insertions, and 1 deletion. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: Minimal · up to 034d3
-
This change stops a nested repository with no commits from breaking the review diff and Changes totals, and other indexing failures are still reported. No concrete merge-blocking risk remains, though behavior on newer Git versions and on Windows has not been checked.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: a nested repository with no commits no longer breaks the review diff. It follows the conventional commit format and matches the change that skips such paths during the… |
| Description check |
 |
The description covers the template sections: Problem, Change, Scope and approval, and Verification. It explains the bug with Git version behavior, the rev-parse HEAD check, why --ignore-errors was re… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the main change: a nested repository with no commits no longer breaks the review diff. It follows the conventional commit format and matches the change that skips such paths during the intent-to-add step.
Full details: Description check
-
Explanation
The description covers the template sections: Problem, Change, Scope and approval, and Verification. It explains the bug with Git version behavior, the rev-parse HEAD check, why --ignore-errors was removed, the three regression tests, and the commands run. It also states what was not checked. The Scope section gives no linked issue but explains why none exists for a small obvious bug, as the template allows.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 11ba35e and 034d396.
Files selected for processing: 2
-
apps/server/src/vcs/GitVcsDriverCore.test.ts
apps/server/src/vcs/GitVcsDriverCore.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
… the review
The earlier fix relied on `git add --intent-to-add --ignore-errors` exiting 1
on a nested repository with no commits. That only holds up to Git 2.52. Since
Git 2.53 (6fe288bfbcbb, read-cache: drop submodule check from add_to_cache())
the add succeeds and records a gitlink, then `git diff --numstat` dies with
"cannot hash scaffold" and exit 128, so the review still failed on CI's Git
2.55.0.
Accepting exit 1 was also too wide. --ignore-errors skips any path Git cannot
index, so an untracked file named git~1 was left out of the diff with no sign
that the result was partial.
Ask each nested repository for its HEAD first and leave out the ones with no
commits, which gives the same result on every Git version. --ignore-errors and
the exit 1 handling are gone, so any other add failure is reported again.
This was referenced Nov 2, 2026
Evidence
Created a committed README.md, changed one line, added one-line untracked notes.txt, and initialized an empty nested scaffold repository. Opened the thread’s Changes diff versus Automatic and refreshed it on both commits.
Environment: Linux Chromium, 1280×800, light theme, Git 2.43.0; fresh synthetic state and replay provider on each side.
Scenario source. The runner exited 0: failed on base because notes.txt was absent; passed on head. Local workspace paths are redacted in base evidence.
Successful proof run log.
Not shown:
- Git 2.53+ subsequent-diff failure mode was not tested; this environment uses Git 2.43.0 and reproduced the tracked-only fallback and undercount.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|