Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): worktree cleanup no longer deletes files hidden by showUntrackedFiles=no #15834

MergedSunkenInTime(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/15834/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 33 additions and 4 deletions.

x
0 of 2 viewed, 2 left
30 additions and 3 deletionsapps/server/src/vcs/GitVcsDriverCore.test.tsModified
View file
@@ -1078,7 +1078,7 @@
_tag: "GitCommandError",
operation: "GitVcsDriver.removeWorktree",
command: "git",
- argumentCount: 3,
+ argumentCount: 5,
assert.notProperty(error, "cause");
@@ -2883,6 +2883,34 @@
+ it.effect("keeps a worktree whose untracked files status is configured to hide", () =>
+ Effect.gen(function* () {
+ const cwd = yield* makeTmpDir();
+ const { initialBranch } = yield* initRepoWithCommit(cwd);
+ const pathService = yield* Path.Path;
+ const worktreePath = pathService.join(yield* makeTmpDir("git-worktrees-"), "hidden");
+ const driver = yield* GitVcsDriver.GitVcsDriver;
+ yield* driver.createWorktree({
+ cwd,
+ path: worktreePath,
+ refName: initialBranch,
+ newRefName: "feature/hidden",
+ });
+ yield* git(cwd, ["config", "status.showUntrackedFiles", "no"]);
+ yield* writeTextFile(worktreePath, "notes.txt", "draft\n");
+ assert.equal(yield* git(worktreePath, ["status", "--porcelain"]), "");