Revert "Git - adopt the new package to use copy-on-write for the worktree include files (#299583)"#300448
Merged
Revert "Git - adopt the new package to use copy-on-write for the worktree include files (#299583)"#300448
Conversation
sandy081
approved these changes
Mar 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reverts a prior change in the built-in Git extension related to copying “worktree include files”, removing the dependency on @vscode/fs-copyfile and returning to Node’s built-in copy implementation.
Changes:
- Remove
@vscode/fs-copyfiledependency (and its lockfile entries). - Switch worktree include file copying from
@vscode/fs-copyfiletofsPromises.cpwithCOPYFILE_FICLONE. - Revert the path-minimization logic used to decide what to copy into the worktree.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| extensions/git/src/repository.ts | Reverts worktree include file path selection and uses fsPromises.cp for copying into worktrees. |
| extensions/git/package.json | Drops the @vscode/fs-copyfile dependency. |
| extensions/git/package-lock.json | Removes @vscode/fs-copyfile and node-addon-api from the lockfile. |
Files not reviewed (1)
- extensions/git/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
extensions/git/src/repository.ts:1941
- In
_getWorktreeIncludePaths, the upward traversal loop uses!gitIgnoredFiles.has(dir)as its stop condition. SincegitIgnoredFilesonly contains file paths (not directories), this condition will almost never stop early, so every file walks all the way up tothis.rooteven if that directory chain was already processed. Consider using!gitIgnoredPaths.has(dir)(or a separate visited set) so directories already added short-circuit the traversal, reducing redundant work on large file sets.
for (const filePath of gitIgnoredFiles) {
let dir = path.dirname(filePath);
while (dir !== this.root && !gitIgnoredFiles.has(dir)) {
gitIgnoredPaths.add(dir);
dir = path.dirname(dir);
}
lszomoru
added a commit
that referenced
this pull request
Mar 16, 2026
) * Reapply "Git - adopt the new package to use copy-on-write for the worktree include files (#299583)" (#300448) This reverts commit c56c7bc. * Attempt to fix tests * Fix build * build: copy node_modules into extension bundle * Regenerate lock file --------- Co-authored-by: deepak1556 <hop2deep@gmail.com>
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
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.
This reverts commit 950ab07.