| ... | ... | @@ -1351,7 +1351,7 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => { |
| 1351 | 1351 | _tag: "GitCommandError", |
| 1352 | 1352 | operation: "GitVcsDriver.removeWorktree", |
| 1353 | 1353 | command: "git", |
| 1354 | | argumentCount: 3, |
| 1354 | argumentCount: 5, |
| 1355 | 1355 | cwd, |
| 1356 | 1356 | }); |
| 1357 | 1357 | assert.notProperty(error, "cause"); |
| ... | ... | @@ -3217,6 +3217,34 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => { |
| 3217 | 3217 | }), |
| 3218 | 3218 | ); |
| 3219 | 3219 | |
| 3220 | it.effect("keeps a worktree whose untracked files status is configured to hide", () => |
| 3221 | Effect.gen(function* () { |
| 3222 | const cwd = yield* makeTmpDir(); |
| 3223 | const { initialBranch } = yield* initRepoWithCommit(cwd); |
| 3224 | const pathService = yield* Path.Path; |
| 3225 | const worktreePath = pathService.join(yield* makeTmpDir("git-worktrees-"), "hidden"); |
| 3226 | const driver = yield* GitVcsDriver.GitVcsDriver; |
| 3227 | yield* driver.createWorktree({ |
| 3228 | cwd, |
| 3229 | path: worktreePath, |
| 3230 | refName: initialBranch, |
| 3231 | newRefName: "feature/hidden", |
| 3232 | }); |
| 3233 | yield* git(cwd, ["config", "status.showUntrackedFiles", "no"]); |
| 3234 | yield* writeTextFile(worktreePath, "notes.txt", "draft\n"); |
| 3235 | assert.equal(yield* git(worktreePath, ["status", "--porcelain"]), ""); |
| 3236 | |
| 3237 | const result = yield* Effect.result(driver.removeWorktree({ cwd, path: worktreePath })); |
| 3238 | |
| 3239 | assert.isTrue(Result.isFailure(result)); |
| 3240 | const fileSystem = yield* FileSystem.FileSystem; |
| 3241 | assert.equal( |
| 3242 | yield* fileSystem.readFileString(pathService.join(worktreePath, "notes.txt")), |
| 3243 | "draft\n", |
| 3244 | ); |
| 3245 | }), |
| 3246 | ); |
| 3247 | |
| 3220 | 3248 | it.effect("allows worktree removal to run longer than the default command timeout", () => |
| 3221 | 3249 | Effect.gen(function* () { |
| 3222 | 3250 | const delegate = yield* ChildProcessSpawner.ChildProcessSpawner; |
| ... | ... | @@ -3225,8 +3253,7 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => { |
| 3225 | 3253 | Effect.gen(function* () { |
| 3226 | 3254 | if ( |
| 3227 | 3255 | ChildProcess.isStandardCommand(command) && |
| 3228 | | command.args[0] === "worktree" && |
| 3229 | | command.args[1] === "remove" |
| 3256 | command.args.join(" ").includes("worktree remove") |
| 3230 | 3257 | ) { |
| 3231 | 3258 | yield* Deferred.succeed(removalStarted, undefined); |
| 3232 | 3259 | yield* Effect.sleep("31 seconds"); |