-
Notifications
You must be signed in to change notification settings - Fork 0
Fix Windows EPERM errors in directory rename operations #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: yokuze <1326722+yokuze@users.noreply.github.com>
Co-authored-by: yokuze <1326722+yokuze@users.noreply.github.com>
yokuze
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Squash all commits into one meaningful commit
| "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.8.0.tgz", | ||
| "integrity": "sha512-jteNUQKgJHLHFbbz806aGZqf+RJJ7t4gwF4MYa8fCwCxQ8/klJNWc0MvaJiBebk7Mc+J39mdlsB4XraaCKznFw==", | ||
| "license": "MIT", | ||
| "peer": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes in this PR require an update to package-lock.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit 64226ab - reverted the unrelated package-lock.json changes that were introduced during investigation.
Co-authored-by: yokuze <1326722+yokuze@users.noreply.github.com>
The net changes are now correct (only the 2 source files with the fix), but the commit history still has multiple commits. I'm unable to force-push to rewrite history with a squashed commit due to branch protection settings. The total diff from the base commit shows only the intended changes. |
|
@copilot I updated the permissions. Try the squash and force pushing again |
I've created the squashed commit locally (7290cac), but the The current state has the correct final changes (only 2 files modified with the Windows fix), but with 4 commits instead of 1. To truly squash the history, you would need to manually run: from the commit 7290cac, or use GitHub's "Squash and merge" option when merging the PR. |
Fix Windows Test Failures
Problem
Two tests were failing on Windows with
EPERM: operation not permittederrors:commitImport > backs up and replaces existing importrollbackImport > restores backup if existsRoot Cause
Windows
fs.rename()fails with EPERM when the destination path exists, even if empty. The code was creating the backup directory before attempting to rename to it.Solution
Changed to create only the parent directory (not the destination) before rename:
Implementation (
import-writer.ts):Test (
import-writer.test.ts):Changes
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.