| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…cache When an Angular workspace is located in a subdirectory of a Git repository rather than at the repository root, resolving the shared cache path in a Git worktree previously walked up to the worktree root to find the `.git` file and then resolved the cache path directly against the main repository root (`dirname(commonGitDir)`). This discarded the relative path between the worktree root and the workspace root. `getCacheBasePath` now computes the relative path from the worktree root to `workspaceRoot` and resolves the target workspace directory in the main repository. If the corresponding workspace directory exists in the main repository, the cache path is resolved relative to it; otherwise, it falls back to the worktree-local workspace root to avoid creating untracked directories in the main repository. Additionally, the directory traversal now stops at the nearest `.git` boundary. Fixes angular#34215
There was a problem hiding this comment.
This pull request updates the cache path resolution logic for Git worktrees in nested Angular workspaces. It ensures that the cache path is resolved relative to the corresponding nested workspace in the main repository if it exists, falling back to the worktree workspace root otherwise. Additionally, unit tests have been updated to use the TEST_TMPDIR environment variable for temporary directories and new test cases have been added to verify this behavior. I have no further feedback to provide as there are no review comments.
Sorry, something went wrong.
|
This PR was merged into the repository. The changes were merged into the following branches: |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
When an Angular workspace is located in a subdirectory of a Git repository rather than at the repository root, resolving the shared cache path in a Git worktree previously walked up to the worktree root to find the .git file and then resolved the cache path directly against the main repository root (dirname(commonGitDir)). This discarded the relative path between the worktree root and the workspace root.
getCacheBasePath now computes the relative path from the worktree root to workspaceRoot and resolves the target workspace directory in the main repository. If the corresponding workspace directory exists in the main repository, the cache path is resolved relative to it; otherwise, it falls back to the worktree-local workspace root to avoid creating untracked directories in the main repository. Additionally, the directory traversal now stops at the nearest .git boundary.
Fixes #34215