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
{{ message }}
Repository navigation
[Bug] Git panel hides uncommitted changes when project path is a symlink #322
Describe the bug
OMPWeb's Git panel reports no changes when a project is opened through a directory symlink, although git status inside the same container reports modified tracked files.
To reproduce
Have a Git repository at /projects/example with a modified tracked file.
Create a directory symlink /workspace/example pointing to /projects/example.
Open the project/session using /workspace/example and inspect the Git panel.
Compare git -C /workspace/example status --short and git -C /workspace/example rev-parse --show-toplevel.
Expected behavior
Equivalent symlink and canonical project paths show the same modified files, while retaining path-boundary/access protections.
Actual behavior
The Git panel reports no changes. In the affected deployment Git reports five modified tracked files; a reproduction of the installed containment filter excludes all five.
Environment
OS: Debian 12 (Bookworm), Docker container on Linux x86-64
Node.js: 24.22.1
omp: 18.12.6
omp-web: @kahme247/ompweb 0.6.0
Browser: not captured; the filtering failure is reproducible server-side
Additional context
In installed lib/git-changes.ts, getGitStatus(cwd) obtains the canonical repository root using git rev-parse --show-toplevel, then filters status entries through:
isWithinPath uses lexical path.resolve / path.relative, not symlink canonicalization. With cwd=/workspace/example and repositoryRoot=/projects/example, a changed file resolves outside the lexical cwd and is discarded even though both paths identify the same repository. /api/git/status passes the requested cwd to this function.
Please normalize equivalent paths consistently across status and diff handling without weakening containment checks. A regression check could compare status results for a temporary repository opened through its canonical path and a symlink alias.
Opening the canonical path is a proposed workaround; I have not independently verified that workaround in the rendered UI. No screenshots attached. Paths above are sanitized examples.
I'll fix this — isWithinPath will compare canonicalized paths (fs.realpathSync, with a lexical fallback for missing paths), so a project opened through a symlink compares equal to the repo root git reports and its changes show up again. Opening a PR with the fix plus a regression test that opens a repo through a directory symlink.
Activity
anhnt256 commentedon Nov 10, 2026
I'll fix this —
isWithinPathwill compare canonicalized paths (fs.realpathSync, with a lexical fallback for missing paths), so a project opened through a symlink compares equal to the repo root git reports and its changes show up again. Opening a PR with the fix plus a regression test that opens a repo through a directory symlink.