MCPcopy Create free account
hub / github.com/coder/mux / expectHealthyWorktree

Function expectHealthyWorktree

tests/runtime/runtime.test.ts:2556–2580  ·  view source on GitHub ↗
(workspacePath: string, branchName: string)

Source from the content-addressed store, hash-verified

2554 );
2555
2556 const expectHealthyWorktree = async (workspacePath: string, branchName: string) => {
2557 const checkoutCheck = await execSSH(
2558 runtime,
2559 `test -f "${workspacePath}/.git" && git -C "${workspacePath}" branch --show-current`
2560 );
2561 expect(checkoutCheck.stdout.trim()).toBe(branchName);
2562
2563 const insideWorkTreeCheck = await execSSH(
2564 runtime,
2565 `git -C "${workspacePath}" rev-parse --is-inside-work-tree`
2566 );
2567 expect(insideWorkTreeCheck.stdout.trim()).toBe("true");
2568
2569 const statusCheck = await execSSH(
2570 runtime,
2571 `git -C "${workspacePath}" status --porcelain`
2572 );
2573 expect(statusCheck.exitCode).toBe(0);
2574
2575 const coreBareCheck = await execSSH(
2576 runtime,
2577 `git -C "${workspacePath}" config --get core.bare`
2578 );
2579 expect(coreBareCheck.exitCode).toBe(1);
2580 };
2581
2582 // 1. Init workspace A — creates the base repo, syncs bundle, creates worktree.
2583 const initA = await runtime.initWorkspace({

Callers 1

runtime.test.tsFile · 0.85

Calls 1

execSSHFunction · 0.85

Tested by

no test coverage detected