Skip to content

Revert "Git - adopt the new package to use copy-on-write for the worktree include files (#299583)"#300448

Merged
lszomoru merged 1 commit intomainfrom
lszomoru/secret-cuckoo
Mar 10, 2026
Merged

Revert "Git - adopt the new package to use copy-on-write for the worktree include files (#299583)"#300448
lszomoru merged 1 commit intomainfrom
lszomoru/secret-cuckoo

Conversation

@lszomoru
Copy link
Member

This reverts commit 950ab07.

Copilot AI review requested due to automatic review settings March 10, 2026 13:43
@lszomoru lszomoru enabled auto-merge (squash) March 10, 2026 13:43
@lszomoru lszomoru self-assigned this Mar 10, 2026
@lszomoru lszomoru added this to the 1.112.0 milestone Mar 10, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-copyfile dependency (and its lockfile entries).
  • Switch worktree include file copying from @vscode/fs-copyfile to fsPromises.cp with COPYFILE_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. Since gitIgnoredFiles only contains file paths (not directories), this condition will almost never stop early, so every file walks all the way up to this.root even 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);
			}

@sandy081 sandy081 disabled auto-merge March 10, 2026 13:53
@lszomoru lszomoru merged commit c56c7bc into main Mar 10, 2026
23 checks passed
@lszomoru lszomoru deleted the lszomoru/secret-cuckoo branch March 10, 2026 14:01
lszomoru added a commit that referenced this pull request Mar 11, 2026
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>
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.

3 participants