GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(server): restore worktree short-name regression coverage · pingdotgg/t3code@7890d40

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/vcs
    • GitVcsDriverCore.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/vcs/GitVcsDriverCore.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/vcs/GitVcsDriverCore.test.ts
+27Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3838,6 +3838,33 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
38383838
}),
38393839
);
38403840

3841+
it.effect("leaves a folder alone that only shares the worktree's short name", () =>
3842+
Effect.gen(function* () {
3843+
const cwd = yield* makeTmpDir();
3844+
const { initialBranch } = yield* initRepoWithCommit(cwd);
3845+
const pathService = yield* Path.Path;
3846+
const fileSystem = yield* FileSystem.FileSystem;
3847+
const driver = yield* GitVcsDriver.GitVcsDriver;
3848+
const worktreePath = pathService.join(yield* makeTmpDir("git-worktrees-"), "short");
3849+
yield* driver.createWorktree({
3850+
cwd,
3851+
path: worktreePath,
3852+
refName: initialBranch,
3853+
newRefName: "feature/short",
3854+
});
3855+
// Unrelated to the worktree, but resolving "short" against cwd lands here.
3856+
const outside = yield* makeTmpDir("git-worktree-link-target-");
3857+
const unrelated = pathService.join(cwd, "short");
3858+
NodeFS.mkdirSync(unrelated);
3859+
NodeFS.symlinkSync(outside, pathService.join(unrelated, "linked"), "junction");
3860+
3861+
yield* Effect.result(driver.removeWorktree({ cwd, path: "short" }));
3862+
3863+
assert.isTrue(NodeFS.lstatSync(pathService.join(unrelated, "linked")).isSymbolicLink());
3864+
assert.equal(yield* fileSystem.exists(worktreePath), true);
3865+
}),
3866+
);
3867+
38413868
it.effect("allows worktree removal to run longer than the default command timeout", () =>
38423869
Effect.gen(function* () {
38433870
const delegate = yield* ChildProcessSpawner.ChildProcessSpawner;

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.