Skip to content

Open untracked directory symlinks and nested repositories in the Changes panel - #530

Open
BunsDev wants to merge 1 commit into
mainfrom
changes-symlink-diff
Open

BunsDev wants to merge 1 commit into
mainfrom
changes-symlink-diff

Conversation

@BunsDev

@BunsDev BunsDev commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Summary

The Changes panel failed to open two kinds of untracked path with Could not access '<path>/null':

  • An untracked symlink to a directory. It now shows the same new-link diff git prints for any other link: one added line holding the link's target, never the directory's contents.
  • An untracked nested repository, which git status lists as dir/. It now shows "No textual diff.", and its row is named after the directory and grouped under its parent.

Every untracked link counts as one added line in the file list. Discarding a link removes only the link, and discarding a nested repository never deletes it.

Cause

Every untracked path was diffed with git diff --no-index /dev/null <path>. git can't compare /dev/null with a directory, and it sees one both through a symlink to a directory and at a nested repository. untrackedDiff() in apps/desktop/src/main/engine/git.ts now handles those two cases. Every other untracked path still goes through git's own diff.

Tests

  • apps/desktop/test/git.test.ts gets 5 new tests:
    • a directory link, including a name with a space and the expanded view;
    • links to a file, to a directory, dangling and looping, plus their line counts;
    • a link inside a project subdirectory;
    • a nested repository that discarding leaves intact;
    • discarding a link to a directory outside the workspace.
  • One directory-link test checks the hand-built diff against git's own output for the same link once its target is gone, so the two can't drift apart.
  • apps/desktop/e2e/review.spec.ts gets one new end-to-end test covering both cases in the panel.

Local results, on an export of main at 538d357 with this change applied:

  • git.test.ts: 25 passed, 0 failed. pnpm --filter @modex/desktop typecheck is clean.
  • Desktop unit suite: 2,544 passed, 30 skipped, 20 failed. The failures are in five files this change doesn't touch: terminal cleanup, offline model evidence, notes watching and question replay. They fail the same way on main without this change: 18 of 71 fail both with and without the patch, run twice. They come from the sandbox the run was in, not from this change.
  • The end-to-end tests couldn't run locally, because Electron isn't allowed to launch in that sandbox. CI runs them.

Provenance

This work was left uncommitted in the fix-changes-symlink-diff worktree, which is still claimed by session:fix-changes-symlink-diff. That worktree was copied from and not changed. This PR is the same diff applied to current main. It adds one fix, moving the ChangesPanel doc comment back onto ChangesPanel after the new rowPath helper had been inserted between them, and it places the status line in the section where main now keeps unreleased changes.

🤖 Generated with Claude Code

The Changes panel diffed every untracked path with `git diff --no-index
/dev/null <path>`. git cannot compare /dev/null with a directory, so an
untracked symlink to a directory, or a nested repository (which status
lists as `dir/`), failed with "Could not access '<path>/null'".

An untracked symlink to a directory now gets the same new-link diff git
prints for any other link: one added line holding the target. A nested
repository shows "No textual diff." and its row is named after its
directory. Every untracked link counts as one added line in the list.
Discarding a link removes only the link, and discarding a nested
repository never deletes it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Nov 27, 2026 9:54am UTC
modex-app Building Building Preview Nov 27, 2026 9:54am UTC

Request Review

@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

main 538d357 changes-symlink-diff 58916e3 +/-
66% 66% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

This branch was successfully deployed

1 active deployment
Preview – modex — 58916e38 Deployed Nov 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant