mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: prevent nul file creation on Windows during checkpoint restore
- Replace simple-git clean() method calls with raw git commands - The simple-git clean() method was incorrectly interpreting the mode parameter - On Windows, this could create reserved filenames like "nul" - Using git.raw(["clean", "-fd"]) directly avoids this issue Fixes #7216
This commit is contained in:
parent
532728ee85
commit
dfe4b820f2
1 changed files with 4 additions and 2 deletions
|
|
@ -250,7 +250,8 @@ export abstract class ShadowCheckpointService extends EventEmitter {
|
|||
}
|
||||
|
||||
const start = Date.now()
|
||||
await this.git.clean("f", ["-d", "-f"])
|
||||
// Use raw git command to avoid issues with simple-git's clean method on Windows
|
||||
await this.git.raw(["clean", "-fd"])
|
||||
await this.git.reset(["--hard", commitHash])
|
||||
|
||||
// Remove all checkpoints after the specified commitHash.
|
||||
|
|
@ -384,7 +385,8 @@ export abstract class ShadowCheckpointService extends EventEmitter {
|
|||
try {
|
||||
await git.raw(["config", "--unset", "core.worktree"])
|
||||
await git.reset(["--hard"])
|
||||
await git.clean("f", ["-d"])
|
||||
// Use raw git command to avoid issues with simple-git's clean method on Windows
|
||||
await git.raw(["clean", "-fd"])
|
||||
const defaultBranch = branches.all.includes("main") ? "main" : "master"
|
||||
await git.checkout([defaultBranch, "--force"])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue