FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(@angular/build): preserve nested workspace path for git worktree cache by clydin · Pull Request #34220 · angular/angular-cli · GitHub

Repository navigation

fix(@angular/build): preserve nested workspace path for git worktree cache - #34220

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:fix-worktree-subfolder-cache
Oct 1, 2026
Merged

clydin merged 1 commit into
angular:mainfrom
clydin:fix-worktree-subfolder-cache

Conversation

clydin commented Oct 1, 2026

Copy link
Copy Markdown
Member

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

…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
clydin added the target: patch This PR is targeted for the next patch release label Oct 1, 2026

gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code Review

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.

clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 1, 2026
alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 1, 2026
clydin merged commit aa53b97 into angular:main Oct 1, 2026
43 checks passed

clydin commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Angular project in subfolder of Git worktree emits cache at root of main Git repo

2 participants


Back | FazBrowse Home | New Git URL