History

[codex] Enforce canonical Node namespace imports (#3238)

Julius Marminge committed 4 months ago

Commit 2fa37ec1 parent db2750271 files · +1205 −952Browse files

Showing the changes to apps/server/src/git (2 of 71 files). Show all

Unified · Split

2 files
  1. apps/server/src/git/GitManager.test.ts +64 −56
  2. apps/server/src/git/Utils.ts +3 −3
apps/server/src/git/GitManager.test.ts+64−56
@@ -1,7 +1,7 @@
1// @effect-diagnostics nodeBuiltinImport:off1// @effect-diagnostics nodeBuiltinImport:off
2import fs from "node:fs";2import * as NodeFS from "node:fs";
3import path from "node:path";3import * as NodePath from "node:path";
4import { spawnSync } from "node:child_process";4import * as NodeChildProcess from "node:child_process";
5 5
6import * as NodeServices from "@effect/platform-node/NodeServices";6import * as NodeServices from "@effect/platform-node/NodeServices";
7import { it } from "@effect/vitest";7import { it } from "@effect/vitest";
@@ -164,7 +164,7 @@ function normalizeFakePullRequestSummary(raw: unknown): GitHubCli.GitHubPullRequ · 156 unmodified lines
164}164}
165 165
166function runGitSyncForFakeGh(cwd: string, args: readonly string[]): void {166function runGitSyncForFakeGh(cwd: string, args: readonly string[]): void {
167 const result = spawnSync("git", args, {167 const result = NodeChildProcess.spawnSync("git", args, {
168 cwd,168 cwd,
169 encoding: "utf8",169 encoding: "utf8",
170 });170 });
@@ -254,7 +254,7 @@ function initRepo( · 83 unmodified lines
254 yield* runGit(cwd, ["init", "--initial-branch=main"]);254 yield* runGit(cwd, ["init", "--initial-branch=main"]);
255 yield* runGit(cwd, ["config", "user.email", "test@example.com"]);255 yield* runGit(cwd, ["config", "user.email", "test@example.com"]);
256 yield* runGit(cwd, ["config", "user.name", "Test User"]);256 yield* runGit(cwd, ["config", "user.name", "Test User"]);
257 yield* fs.writeFileString(path.join(cwd, "README.md"), "hello\n");257 yield* fs.writeFileString(NodePath.join(cwd, "README.md"), "hello\n");
258 yield* runGit(cwd, ["add", "README.md"]);258 yield* runGit(cwd, ["add", "README.md"]);
259 yield* runGit(cwd, ["commit", "-m", "Initial commit"]);259 yield* runGit(cwd, ["commit", "-m", "Initial commit"]);
260 });260 });
@@ -459,7 +459,7 @@ function createGitHubCliWithFakeGh(scenario: FakeGhScenario = {}): { · 198 unmodified lines
459 try: () => {459 try: () => {
460 const headBranch = scenario.pullRequest?.headRefName;460 const headBranch = scenario.pullRequest?.headRefName;
461 if (headBranch) {461 if (headBranch) {
462 const existingBranch = spawnSync(462 const existingBranch = NodeChildProcess.spawnSync(
463 "git",463 "git",
464 ["show-ref", "--verify", "--quiet", `refs/heads/${headBranch}`],464 ["show-ref", "--verify", "--quiet", `refs/heads/${headBranch}`],
465 {465 {
@@ -916,7 +916,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 450 unmodified lines
916 it.effect("status returns an explicit non-repo result for deleted directories", () =>916 it.effect("status returns an explicit non-repo result for deleted directories", () =>
917 Effect.gen(function* () {917 Effect.gen(function* () {
918 const rootDir = yield* makeTempDir("t3code-git-manager-missing-dir-");918 const rootDir = yield* makeTempDir("t3code-git-manager-missing-dir-");
919 const cwd = path.join(rootDir, "deleted-repo");919 const cwd = NodePath.join(rootDir, "deleted-repo");
920 yield* makeDirectory(cwd);920 yield* makeDirectory(cwd);
921 yield* removePath(cwd);921 yield* removePath(cwd);
922 const { manager } = yield* makeManager();922 const { manager } = yield* makeManager();
@@ -1026,7 +1026,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 103 unmodified lines
1026 const forkDir = yield* createBareRemote();1026 const forkDir = yield* createBareRemote();
1027 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);1027 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);
1028 yield* runGit(repoDir, ["checkout", "-b", "statemachine"]);1028 yield* runGit(repoDir, ["checkout", "-b", "statemachine"]);
1029 fs.writeFileSync(path.join(repoDir, "fork-pr.txt"), "fork pr\n");1029 NodeFS.writeFileSync(NodePath.join(repoDir, "fork-pr.txt"), "fork pr\n");
1030 yield* runGit(repoDir, ["add", "fork-pr.txt"]);1030 yield* runGit(repoDir, ["add", "fork-pr.txt"]);
1031 yield* runGit(repoDir, ["commit", "-m", "Fork PR branch"]);1031 yield* runGit(repoDir, ["commit", "-m", "Fork PR branch"]);
1032 yield* runGit(repoDir, ["push", "-u", "fork-seed", "statemachine"]);1032 yield* runGit(repoDir, ["push", "-u", "fork-seed", "statemachine"]);
@@ -1348,7 +1348,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 315 unmodified lines
1348 Effect.gen(function* () {1348 Effect.gen(function* () {
1349 const repoDir = yield* makeTempDir("t3code-git-manager-");1349 const repoDir = yield* makeTempDir("t3code-git-manager-");
1350 yield* initRepo(repoDir);1350 yield* initRepo(repoDir);
1351 fs.writeFileSync(path.join(repoDir, "README.md"), "hello\nworld\n");1351 NodeFS.writeFileSync(NodePath.join(repoDir, "README.md"), "hello\nworld\n");
1352 1352
1353 const { manager } = yield* makeManager();1353 const { manager } = yield* makeManager();
1354 const result = yield* runStackedAction(manager, {1354 const result = yield* runStackedAction(manager, {
@@ -1383,7 +1383,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 28 unmodified lines
1383 Effect.gen(function* () {1383 Effect.gen(function* () {
1384 const repoDir = yield* makeTempDir("t3code-git-manager-");1384 const repoDir = yield* makeTempDir("t3code-git-manager-");
1385 yield* initRepo(repoDir);1385 yield* initRepo(repoDir);
1386 fs.writeFileSync(path.join(repoDir, "README.md"), "hello\ncustom\n");1386 NodeFS.writeFileSync(NodePath.join(repoDir, "README.md"), "hello\ncustom\n");
1387 let generatedCount = 0;1387 let generatedCount = 0;
1388 1388
1389 const { manager } = yield* makeManager({1389 const { manager } = yield* makeManager({
@@ -1426,8 +1426,8 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 36 unmodified lines
1426 Effect.gen(function* () {1426 Effect.gen(function* () {
1427 const repoDir = yield* makeTempDir("t3code-git-manager-");1427 const repoDir = yield* makeTempDir("t3code-git-manager-");
1428 yield* initRepo(repoDir);1428 yield* initRepo(repoDir);
1429 fs.writeFileSync(path.join(repoDir, "a.txt"), "file a\n");1429 NodeFS.writeFileSync(NodePath.join(repoDir, "a.txt"), "file a\n");
1430 fs.writeFileSync(path.join(repoDir, "b.txt"), "file b\n");1430 NodeFS.writeFileSync(NodePath.join(repoDir, "b.txt"), "file b\n");
1431 1431
1432 const { manager } = yield* makeManager();1432 const { manager } = yield* makeManager();
1433 const result = yield* runStackedAction(manager, {1433 const result = yield* runStackedAction(manager, {
@@ -1454,7 +1454,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 20 unmodified lines
1454 const remoteDir = yield* createBareRemote();1454 const remoteDir = yield* createBareRemote();
1455 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);1455 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
1456 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);1456 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
1457 fs.writeFileSync(path.join(repoDir, "README.md"), "hello\nfeature-branch\n");1457 NodeFS.writeFileSync(NodePath.join(repoDir, "README.md"), "hello\nfeature-branch\n");
1458 let generatedCount = 0;1458 let generatedCount = 0;
1459 1459
1460 const { manager } = yield* makeManager({1460 const { manager } = yield* makeManager({
@@ -1514,7 +1514,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 53 unmodified lines
1514 Effect.gen(function* () {1514 Effect.gen(function* () {
1515 const repoDir = yield* makeTempDir("t3code-git-manager-");1515 const repoDir = yield* makeTempDir("t3code-git-manager-");
1516 yield* initRepo(repoDir);1516 yield* initRepo(repoDir);
1517 fs.writeFileSync(path.join(repoDir, "README.md"), "hello\ncustom-feature\n");1517 NodeFS.writeFileSync(NodePath.join(repoDir, "README.md"), "hello\ncustom-feature\n");
1518 let generatedCount = 0;1518 let generatedCount = 0;
1519 1519
1520 const { manager } = yield* makeManager({1520 const { manager } = yield* makeManager({
@@ -1597,7 +1597,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 76 unmodified lines
1597 yield* runGit(repoDir, ["checkout", "-b", "feature/stacked-flow"]);1597 yield* runGit(repoDir, ["checkout", "-b", "feature/stacked-flow"]);
1598 const remoteDir = yield* createBareRemote();1598 const remoteDir = yield* createBareRemote();
1599 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);1599 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
1600 fs.writeFileSync(path.join(repoDir, "feature.txt"), "feature\n");1600 NodeFS.writeFileSync(NodePath.join(repoDir, "feature.txt"), "feature\n");
1601 1601
1602 const { manager } = yield* makeManager();1602 const { manager } = yield* makeManager();
1603 const result = yield* runStackedAction(manager, {1603 const result = yield* runStackedAction(manager, {
@@ -1626,7 +1626,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 22 unmodified lines
1626 yield* runGit(repoDir, ["checkout", "-b", "feature/no-upstream-pr"]);1626 yield* runGit(repoDir, ["checkout", "-b", "feature/no-upstream-pr"]);
1627 const remoteDir = yield* createBareRemote();1627 const remoteDir = yield* createBareRemote();
1628 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);1628 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
1629 fs.writeFileSync(path.join(repoDir, "feature.txt"), "feature\n");1629 NodeFS.writeFileSync(NodePath.join(repoDir, "feature.txt"), "feature\n");
1630 1630
1631 const { manager, ghCalls } = yield* makeManager({1631 const { manager, ghCalls } = yield* makeManager({
1632 ghScenario: {1632 ghScenario: {
@@ -1697,7 +1697,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 64 unmodified lines
1697 yield* runGit(repoDir, ["checkout", "-b", "feature/push-only"]);1697 yield* runGit(repoDir, ["checkout", "-b", "feature/push-only"]);
1698 const remoteDir = yield* createBareRemote();1698 const remoteDir = yield* createBareRemote();
1699 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);1699 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
1700 fs.writeFileSync(path.join(repoDir, "push-only.txt"), "push only\n");1700 NodeFS.writeFileSync(NodePath.join(repoDir, "push-only.txt"), "push only\n");
1701 yield* runGit(repoDir, ["add", "push-only.txt"]);1701 yield* runGit(repoDir, ["add", "push-only.txt"]);
1702 yield* runGit(repoDir, ["commit", "-m", "Push only branch"]);1702 yield* runGit(repoDir, ["commit", "-m", "Push only branch"]);
1703 1703
@@ -1725,11 +1725,11 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 21 unmodified lines
1725 yield* runGit(repoDir, ["checkout", "-b", "feature/push-dirty"]);1725 yield* runGit(repoDir, ["checkout", "-b", "feature/push-dirty"]);
1726 const remoteDir = yield* createBareRemote();1726 const remoteDir = yield* createBareRemote();
1727 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);1727 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
1728 fs.writeFileSync(path.join(repoDir, "push-dirty.txt"), "push dirty\n");1728 NodeFS.writeFileSync(NodePath.join(repoDir, "push-dirty.txt"), "push dirty\n");
1729 yield* runGit(repoDir, ["add", "push-dirty.txt"]);1729 yield* runGit(repoDir, ["add", "push-dirty.txt"]);
1730 yield* runGit(repoDir, ["commit", "-m", "Push dirty branch"]);1730 yield* runGit(repoDir, ["commit", "-m", "Push dirty branch"]);
1731 fs.mkdirSync(path.join(repoDir, ".vercel"));1731 NodeFS.mkdirSync(NodePath.join(repoDir, ".vercel"));
1732 fs.writeFileSync(path.join(repoDir, ".vercel", "project.json"), "{}\n");1732 NodeFS.writeFileSync(NodePath.join(repoDir, ".vercel", "project.json"), "{}\n");
1733 1733
1734 const { manager } = yield* makeManager();1734 const { manager } = yield* makeManager();
1735 const result = yield* runStackedAction(manager, {1735 const result = yield* runStackedAction(manager, {
@@ -1760,7 +1760,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 24 unmodified lines
1760 yield* runGit(repoDir, ["checkout", "-b", "feature/create-pr-only"]);1760 yield* runGit(repoDir, ["checkout", "-b", "feature/create-pr-only"]);
1761 const remoteDir = yield* createBareRemote();1761 const remoteDir = yield* createBareRemote();
1762 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);1762 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
1763 fs.writeFileSync(path.join(repoDir, "create-pr-only.txt"), "create pr\n");1763 NodeFS.writeFileSync(NodePath.join(repoDir, "create-pr-only.txt"), "create pr\n");
1764 yield* runGit(repoDir, ["add", "create-pr-only.txt"]);1764 yield* runGit(repoDir, ["add", "create-pr-only.txt"]);
1765 yield* runGit(repoDir, ["commit", "-m", "Create PR only branch"]);1765 yield* runGit(repoDir, ["commit", "-m", "Create PR only branch"]);
1766 1766
@@ -1805,7 +1805,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 38 unmodified lines
1805 const repoDir = yield* makeTempDir("t3code-git-manager-");1805 const repoDir = yield* makeTempDir("t3code-git-manager-");
1806 yield* initRepo(repoDir);1806 yield* initRepo(repoDir);
1807 yield* runGit(repoDir, ["checkout", "-b", "feature/provider-fallback"]);1807 yield* runGit(repoDir, ["checkout", "-b", "feature/provider-fallback"]);
1808 fs.writeFileSync(path.join(repoDir, "provider-fallback.txt"), "fallback\n");1808 NodeFS.writeFileSync(NodePath.join(repoDir, "provider-fallback.txt"), "fallback\n");
1809 yield* runGit(repoDir, ["add", "provider-fallback.txt"]);1809 yield* runGit(repoDir, ["add", "provider-fallback.txt"]);
1810 yield* runGit(repoDir, ["commit", "-m", "Provider fallback"]);1810 yield* runGit(repoDir, ["commit", "-m", "Provider fallback"]);
1811 const remoteDir = yield* createBareRemote();1811 const remoteDir = yield* createBareRemote();
@@ -1982,7 +1982,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 170 unmodified lines
1982 yield* runGit(repoDir, ["checkout", "main"]);1982 yield* runGit(repoDir, ["checkout", "main"]);
1983 yield* runGit(repoDir, ["branch", "-D", "effect-atom"]);1983 yield* runGit(repoDir, ["branch", "-D", "effect-atom"]);
1984 yield* runGit(repoDir, ["checkout", "--track", "my-org/upstream/effect-atom"]);1984 yield* runGit(repoDir, ["checkout", "--track", "my-org/upstream/effect-atom"]);
1985 fs.writeFileSync(path.join(repoDir, "changes.txt"), "change\n");1985 NodeFS.writeFileSync(NodePath.join(repoDir, "changes.txt"), "change\n");
1986 yield* runGit(repoDir, ["add", "changes.txt"]);1986 yield* runGit(repoDir, ["add", "changes.txt"]);
1987 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);1987 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);
1988 1988
@@ -2200,7 +2200,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 211 unmodified lines
2200 yield* runGit(repoDir, ["checkout", "-b", "feature-create-pr"]);2200 yield* runGit(repoDir, ["checkout", "-b", "feature-create-pr"]);
2201 const remoteDir = yield* createBareRemote();2201 const remoteDir = yield* createBareRemote();
2202 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);2202 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
2203 fs.writeFileSync(path.join(repoDir, "changes.txt"), "change\n");2203 NodeFS.writeFileSync(NodePath.join(repoDir, "changes.txt"), "change\n");
2204 yield* runGit(repoDir, ["add", "changes.txt"]);2204 yield* runGit(repoDir, ["add", "changes.txt"]);
2205 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);2205 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);
2206 yield* runGit(repoDir, ["push", "-u", "origin", "feature-create-pr"]);2206 yield* runGit(repoDir, ["push", "-u", "origin", "feature-create-pr"]);
@@ -2252,7 +2252,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 45 unmodified lines
2252 yield* runGit(peerDir, ["clone", remoteDir, "."]);2252 yield* runGit(peerDir, ["clone", remoteDir, "."]);
2253 yield* runGit(peerDir, ["config", "user.email", "peer@example.com"]);2253 yield* runGit(peerDir, ["config", "user.email", "peer@example.com"]);
2254 yield* runGit(peerDir, ["config", "user.name", "Peer User"]);2254 yield* runGit(peerDir, ["config", "user.name", "Peer User"]);
2255 fs.writeFileSync(path.join(peerDir, "remote.txt"), "remote\n");2255 NodeFS.writeFileSync(NodePath.join(peerDir, "remote.txt"), "remote\n");
2256 yield* runGit(peerDir, ["add", "remote.txt"]);2256 yield* runGit(peerDir, ["add", "remote.txt"]);
2257 yield* runGit(peerDir, ["commit", "-m", "Remote base commit"]);2257 yield* runGit(peerDir, ["commit", "-m", "Remote base commit"]);
2258 yield* runGit(peerDir, ["push", "origin", "main"]);2258 yield* runGit(peerDir, ["push", "origin", "main"]);
@@ -2265,7 +2265,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 6 unmodified lines
2265 "feature/remote-base",2265 "feature/remote-base",
2266 "origin/main",2266 "origin/main",
2267 ]);2267 ]);
2268 fs.writeFileSync(path.join(repoDir, "feature.txt"), "feature\n");2268 NodeFS.writeFileSync(NodePath.join(repoDir, "feature.txt"), "feature\n");
2269 yield* runGit(repoDir, ["add", "feature.txt"]);2269 yield* runGit(repoDir, ["add", "feature.txt"]);
2270 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);2270 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);
2271 yield* runGit(repoDir, ["push", "-u", "origin", "feature/remote-base"]);2271 yield* runGit(repoDir, ["push", "-u", "origin", "feature/remote-base"]);
@@ -2304,7 +2304,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 32 unmodified lines
2304 yield* runGit(repoDir, ["checkout", "-b", "feature/no-fork-match"]);2304 yield* runGit(repoDir, ["checkout", "-b", "feature/no-fork-match"]);
2305 const remoteDir = yield* createBareRemote();2305 const remoteDir = yield* createBareRemote();
2306 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);2306 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
2307 fs.writeFileSync(path.join(repoDir, "changes.txt"), "change\n");2307 NodeFS.writeFileSync(NodePath.join(repoDir, "changes.txt"), "change\n");
2308 yield* runGit(repoDir, ["add", "changes.txt"]);2308 yield* runGit(repoDir, ["add", "changes.txt"]);
2309 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);2309 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);
2310 yield* runGit(repoDir, ["push", "-u", "origin", "feature/no-fork-match"]);2310 yield* runGit(repoDir, ["push", "-u", "origin", "feature/no-fork-match"]);
@@ -2376,7 +2376,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 65 unmodified lines
2376 const forkDir = yield* createBareRemote();2376 const forkDir = yield* createBareRemote();
2377 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);2377 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);
2378 yield* runGit(repoDir, ["checkout", "-b", "statemachine"]);2378 yield* runGit(repoDir, ["checkout", "-b", "statemachine"]);
2379 fs.writeFileSync(path.join(repoDir, "changes.txt"), "change\n");2379 NodeFS.writeFileSync(NodePath.join(repoDir, "changes.txt"), "change\n");
2380 yield* runGit(repoDir, ["add", "changes.txt"]);2380 yield* runGit(repoDir, ["add", "changes.txt"]);
2381 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);2381 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);
2382 yield* runGit(repoDir, ["push", "-u", "fork-seed", "statemachine"]);2382 yield* runGit(repoDir, ["push", "-u", "fork-seed", "statemachine"]);
@@ -2556,7 +2556,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 173 unmodified lines
2556 const repoDir = yield* makeTempDir("t3code-git-manager-");2556 const repoDir = yield* makeTempDir("t3code-git-manager-");
2557 yield* initRepo(repoDir);2557 yield* initRepo(repoDir);
2558 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-local"]);2558 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-local"]);
2559 fs.writeFileSync(path.join(repoDir, "local.txt"), "local\n");2559 NodeFS.writeFileSync(NodePath.join(repoDir, "local.txt"), "local\n");
2560 yield* runGit(repoDir, ["add", "local.txt"]);2560 yield* runGit(repoDir, ["add", "local.txt"]);
2561 yield* runGit(repoDir, ["commit", "-m", "Local PR branch"]);2561 yield* runGit(repoDir, ["commit", "-m", "Local PR branch"]);
2562 2562
@@ -2597,7 +2597,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 34 unmodified lines
2597 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);2597 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
2598 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);2598 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
2599 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-local-upstream"]);2599 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-local-upstream"]);
2600 fs.writeFileSync(path.join(repoDir, "upstream.txt"), "upstream\n");2600 NodeFS.writeFileSync(NodePath.join(repoDir, "upstream.txt"), "upstream\n");
2601 yield* runGit(repoDir, ["add", "upstream.txt"]);2601 yield* runGit(repoDir, ["add", "upstream.txt"]);
2602 yield* runGit(repoDir, ["commit", "-m", "Local upstream PR branch"]);2602 yield* runGit(repoDir, ["commit", "-m", "Local upstream PR branch"]);
2603 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-local-upstream"]);2603 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-local-upstream"]);
@@ -2655,7 +2655,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 51 unmodified lines
2655 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);2655 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
2656 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);2656 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
2657 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-local-no-head-repo"]);2657 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-local-no-head-repo"]);
2658 fs.writeFileSync(path.join(repoDir, "no-head-repo.txt"), "upstream\n");2658 NodeFS.writeFileSync(NodePath.join(repoDir, "no-head-repo.txt"), "upstream\n");
2659 yield* runGit(repoDir, ["add", "no-head-repo.txt"]);2659 yield* runGit(repoDir, ["add", "no-head-repo.txt"]);
2660 yield* runGit(repoDir, ["commit", "-m", "Local PR branch without repo metadata"]);2660 yield* runGit(repoDir, ["commit", "-m", "Local PR branch without repo metadata"]);
2661 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-local-no-head-repo"]);2661 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-local-no-head-repo"]);
@@ -2702,7 +2702,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 40 unmodified lines
2702 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);2702 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
2703 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);2703 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
2704 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-worktree"]);2704 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-worktree"]);
2705 fs.writeFileSync(path.join(repoDir, "worktree.txt"), "worktree\n");2705 NodeFS.writeFileSync(NodePath.join(repoDir, "worktree.txt"), "worktree\n");
2706 yield* runGit(repoDir, ["add", "worktree.txt"]);2706 yield* runGit(repoDir, ["add", "worktree.txt"]);
2707 yield* runGit(repoDir, ["commit", "-m", "PR worktree branch"]);2707 yield* runGit(repoDir, ["commit", "-m", "PR worktree branch"]);
2708 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-worktree"]);2708 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-worktree"]);
@@ -2730,7 +2730,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 21 unmodified lines
2730 2730
2731 expect(result.branch).toBe("feature/pr-worktree");2731 expect(result.branch).toBe("feature/pr-worktree");
2732 expect(result.worktreePath).not.toBeNull();2732 expect(result.worktreePath).not.toBeNull();
2733 expect(fs.existsSync(result.worktreePath as string)).toBe(true);2733 expect(NodeFS.existsSync(result.worktreePath as string)).toBe(true);
2734 const worktreeBranch = (yield* runGit(result.worktreePath as string, [2734 const worktreeBranch = (yield* runGit(result.worktreePath as string, [
2735 "branch",2735 "branch",
2736 "--show-current",2736 "--show-current",
@@ -2747,7 +2747,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 10 unmodified lines
2747 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);2747 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
2748 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);2748 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
2749 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-worktree-setup"]);2749 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-worktree-setup"]);
2750 fs.writeFileSync(path.join(repoDir, "setup.txt"), "setup\n");2750 NodeFS.writeFileSync(NodePath.join(repoDir, "setup.txt"), "setup\n");
2751 yield* runGit(repoDir, ["add", "setup.txt"]);2751 yield* runGit(repoDir, ["add", "setup.txt"]);
2752 yield* runGit(repoDir, ["commit", "-m", "PR worktree setup branch"]);2752 yield* runGit(repoDir, ["commit", "-m", "PR worktree setup branch"]);
2753 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-worktree-setup"]);2753 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-worktree-setup"]);
@@ -2802,7 +2802,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 48 unmodified lines
2802 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);2802 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
2803 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);2803 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);
2804 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-fork"]);2804 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-fork"]);
2805 fs.writeFileSync(path.join(repoDir, "fork.txt"), "fork\n");2805 NodeFS.writeFileSync(NodePath.join(repoDir, "fork.txt"), "fork\n");
2806 yield* runGit(repoDir, ["add", "fork.txt"]);2806 yield* runGit(repoDir, ["add", "fork.txt"]);
2807 yield* runGit(repoDir, ["commit", "-m", "Fork PR branch"]);2807 yield* runGit(repoDir, ["commit", "-m", "Fork PR branch"]);
2808 yield* runGit(repoDir, ["push", "-u", "fork-seed", "feature/pr-fork"]);2808 yield* runGit(repoDir, ["push", "-u", "fork-seed", "feature/pr-fork"]);
@@ -2864,7 +2864,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 55 unmodified lines
2864 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);2864 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
2865 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);2865 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);
2866 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-local-fork"]);2866 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-local-fork"]);
2867 fs.writeFileSync(path.join(repoDir, "local-fork.txt"), "local fork\n");2867 NodeFS.writeFileSync(NodePath.join(repoDir, "local-fork.txt"), "local fork\n");
2868 yield* runGit(repoDir, ["add", "local-fork.txt"]);2868 yield* runGit(repoDir, ["add", "local-fork.txt"]);
2869 yield* runGit(repoDir, ["commit", "-m", "Local fork PR branch"]);2869 yield* runGit(repoDir, ["commit", "-m", "Local fork PR branch"]);
2870 yield* runGit(repoDir, ["push", "-u", "fork-seed", "feature/pr-local-fork"]);2870 yield* runGit(repoDir, ["push", "-u", "fork-seed", "feature/pr-local-fork"]);
@@ -2917,7 +2917,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 46 unmodified lines
2917 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);2917 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
2918 yield* runGit(repoDir, ["remote", "add", "binbandit-seed", forkDir]);2918 yield* runGit(repoDir, ["remote", "add", "binbandit-seed", forkDir]);
2919 yield* runGit(repoDir, ["checkout", "-b", "fix/git-action-default-without-origin"]);2919 yield* runGit(repoDir, ["checkout", "-b", "fix/git-action-default-without-origin"]);
2920 fs.writeFileSync(path.join(repoDir, "derived-fork.txt"), "derived fork\n");2920 NodeFS.writeFileSync(NodePath.join(repoDir, "derived-fork.txt"), "derived fork\n");
2921 yield* runGit(repoDir, ["add", "derived-fork.txt"]);2921 yield* runGit(repoDir, ["add", "derived-fork.txt"]);
2922 yield* runGit(repoDir, ["commit", "-m", "Derived fork PR branch"]);2922 yield* runGit(repoDir, ["commit", "-m", "Derived fork PR branch"]);
2923 yield* runGit(repoDir, [2923 yield* runGit(repoDir, [
@@ -2969,11 +2969,15 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 45 unmodified lines
2969 const repoDir = yield* makeTempDir("t3code-git-manager-");2969 const repoDir = yield* makeTempDir("t3code-git-manager-");
2970 yield* initRepo(repoDir);2970 yield* initRepo(repoDir);
2971 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-existing-worktree"]);2971 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-existing-worktree"]);
2972 fs.writeFileSync(path.join(repoDir, "existing.txt"), "existing\n");2972 NodeFS.writeFileSync(NodePath.join(repoDir, "existing.txt"), "existing\n");
2973 yield* runGit(repoDir, ["add", "existing.txt"]);2973 yield* runGit(repoDir, ["add", "existing.txt"]);
2974 yield* runGit(repoDir, ["commit", "-m", "Existing worktree branch"]);2974 yield* runGit(repoDir, ["commit", "-m", "Existing worktree branch"]);
2975 yield* runGit(repoDir, ["checkout", "main"]);2975 yield* runGit(repoDir, ["checkout", "main"]);
2976 const worktreePath = path.join(repoDir, "..", `pr-existing-${path.basename(repoDir)}`);2976 const worktreePath = NodePath.join(
2977 repoDir,
2978 "..",
2979 `pr-existing-${NodePath.basename(repoDir)}`,
2980 );
2977 yield* runGit(repoDir, ["worktree", "add", worktreePath, "feature/pr-existing-worktree"]);2981 yield* runGit(repoDir, ["worktree", "add", worktreePath, "feature/pr-existing-worktree"]);
2978 2982
2979 const setupCalls: ProjectSetupScriptRunner.ProjectSetupScriptRunnerInput[] = [];2983 const setupCalls: ProjectSetupScriptRunner.ProjectSetupScriptRunnerInput[] = [];
@@ -3004,8 +3008,8 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 24 unmodified lines
3004 threadId: asThreadId("thread-pr-existing-worktree"),3008 threadId: asThreadId("thread-pr-existing-worktree"),
3005 });3009 });
3006 3010
3007 expect(result.worktreePath && fs.realpathSync.native(result.worktreePath)).toBe(3011 expect(result.worktreePath && NodeFS.realpathSync.native(result.worktreePath)).toBe(
3008 fs.realpathSync.native(worktreePath),3012 NodeFS.realpathSync.native(worktreePath),
3009 );3013 );
3010 expect(result.branch).toBe("feature/pr-existing-worktree");3014 expect(result.branch).toBe("feature/pr-existing-worktree");
3011 expect(setupCalls).toHaveLength(0);3015 expect(setupCalls).toHaveLength(0);
@@ -3024,7 +3028,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 12 unmodified lines
3024 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);3028 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
3025 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);3029 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);
3026 yield* runGit(repoDir, ["checkout", "-b", "fork-main-source"]);3030 yield* runGit(repoDir, ["checkout", "-b", "fork-main-source"]);
3027 fs.writeFileSync(path.join(repoDir, "fork-main.txt"), "fork main\n");3031 NodeFS.writeFileSync(NodePath.join(repoDir, "fork-main.txt"), "fork main\n");
3028 yield* runGit(repoDir, ["add", "fork-main.txt"]);3032 yield* runGit(repoDir, ["add", "fork-main.txt"]);
3029 yield* runGit(repoDir, ["commit", "-m", "Fork main branch"]);3033 yield* runGit(repoDir, ["commit", "-m", "Fork main branch"]);
3030 yield* runGit(repoDir, ["push", "-u", "fork-seed", "fork-main-source:main"]);3034 yield* runGit(repoDir, ["push", "-u", "fork-seed", "fork-main-source:main"]);
@@ -3084,7 +3088,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 53 unmodified lines
3084 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);3088 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
3085 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);3089 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);
3086 yield* runGit(repoDir, ["checkout", "-b", "fork-main-source"]);3090 yield* runGit(repoDir, ["checkout", "-b", "fork-main-source"]);
3087 fs.writeFileSync(path.join(repoDir, "fork-main-second.txt"), "fork main second\n");3091 NodeFS.writeFileSync(NodePath.join(repoDir, "fork-main-second.txt"), "fork main second\n");
3088 yield* runGit(repoDir, ["add", "fork-main-second.txt"]);3092 yield* runGit(repoDir, ["add", "fork-main-second.txt"]);
3089 yield* runGit(repoDir, ["commit", "-m", "Fork main second branch"]);3093 yield* runGit(repoDir, ["commit", "-m", "Fork main second branch"]);
3090 yield* runGit(repoDir, ["push", "-u", "fork-seed", "fork-main-source:main"]);3094 yield* runGit(repoDir, ["push", "-u", "fork-seed", "fork-main-source:main"]);
@@ -3142,12 +3146,16 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 51 unmodified lines
3142 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);3146 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
3143 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);3147 yield* runGit(repoDir, ["remote", "add", "fork-seed", forkDir]);
3144 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-reused-fork"]);3148 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-reused-fork"]);
3145 fs.writeFileSync(path.join(repoDir, "reused-fork.txt"), "reused fork\n");3149 NodeFS.writeFileSync(NodePath.join(repoDir, "reused-fork.txt"), "reused fork\n");
3146 yield* runGit(repoDir, ["add", "reused-fork.txt"]);3150 yield* runGit(repoDir, ["add", "reused-fork.txt"]);
3147 yield* runGit(repoDir, ["commit", "-m", "Reused fork PR branch"]);3151 yield* runGit(repoDir, ["commit", "-m", "Reused fork PR branch"]);
3148 yield* runGit(repoDir, ["push", "-u", "fork-seed", "feature/pr-reused-fork"]);3152 yield* runGit(repoDir, ["push", "-u", "fork-seed", "feature/pr-reused-fork"]);
3149 yield* runGit(repoDir, ["checkout", "main"]);3153 yield* runGit(repoDir, ["checkout", "main"]);
3150 const worktreePath = path.join(repoDir, "..", `pr-reused-fork-${path.basename(repoDir)}`);3154 const worktreePath = NodePath.join(
3155 repoDir,
3156 "..",
3157 `pr-reused-fork-${NodePath.basename(repoDir)}`,
3158 );
3151 yield* runGit(repoDir, ["worktree", "add", worktreePath, "feature/pr-reused-fork"]);3159 yield* runGit(repoDir, ["worktree", "add", worktreePath, "feature/pr-reused-fork"]);
3152 yield* runGit(worktreePath, ["branch", "--unset-upstream"], true);3160 yield* runGit(worktreePath, ["branch", "--unset-upstream"], true);
3153 3161
@@ -3179,8 +3187,8 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 25 unmodified lines
3179 mode: "worktree",3187 mode: "worktree",
3180 });3188 });
3181 3189
3182 expect(result.worktreePath && fs.realpathSync.native(result.worktreePath)).toBe(3190 expect(result.worktreePath && NodeFS.realpathSync.native(result.worktreePath)).toBe(
3183 fs.realpathSync.native(worktreePath),3191 NodeFS.realpathSync.native(worktreePath),
3184 );3192 );
3185 expect(3193 expect(
3186 (yield* runGit(worktreePath, ["rev-parse", "--abbrev-ref", "@{upstream}"])).stdout.trim(),3194 (yield* runGit(worktreePath, ["rev-parse", "--abbrev-ref", "@{upstream}"])).stdout.trim(),
@@ -3196,7 +3204,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 9 unmodified lines
3196 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);3204 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
3197 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);3205 yield* runGit(repoDir, ["push", "-u", "origin", "main"]);
3198 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-setup-failure"]);3206 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-setup-failure"]);
3199 fs.writeFileSync(path.join(repoDir, "setup-failure.txt"), "setup failure\n");3207 NodeFS.writeFileSync(NodePath.join(repoDir, "setup-failure.txt"), "setup failure\n");
3200 yield* runGit(repoDir, ["add", "setup-failure.txt"]);3208 yield* runGit(repoDir, ["add", "setup-failure.txt"]);
3201 yield* runGit(repoDir, ["commit", "-m", "PR setup failure branch"]);3209 yield* runGit(repoDir, ["commit", "-m", "PR setup failure branch"]);
3202 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-setup-failure"]);3210 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-setup-failure"]);
@@ -3236,7 +3244,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 33 unmodified lines
3236 3244
3237 expect(result.branch).toBe("feature/pr-setup-failure");3245 expect(result.branch).toBe("feature/pr-setup-failure");
3238 expect(result.worktreePath).not.toBeNull();3246 expect(result.worktreePath).not.toBeNull();
3239 expect(fs.existsSync(result.worktreePath as string)).toBe(true);3247 expect(NodeFS.existsSync(result.worktreePath as string)).toBe(true);
3240 }),3248 }),
3241 );3249 );
3242 3250
@@ -3276,9 +3284,9 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 33 unmodified lines
3276 Effect.gen(function* () {3284 Effect.gen(function* () {
3277 const repoDir = yield* makeTempDir("t3code-git-manager-");3285 const repoDir = yield* makeTempDir("t3code-git-manager-");
3278 yield* initRepo(repoDir);3286 yield* initRepo(repoDir);
3279 fs.writeFileSync(path.join(repoDir, "hooked.txt"), "hooked\n");3287 NodeFS.writeFileSync(NodePath.join(repoDir, "hooked.txt"), "hooked\n");
3280 fs.writeFileSync(3288 NodeFS.writeFileSync(
3281 path.join(repoDir, ".git", "hooks", "pre-commit"),3289 NodePath.join(repoDir, ".git", "hooks", "pre-commit"),
3282 '#!/bin/sh\necho "hook: start" >&2\nsleep 0.05\necho "hook: end" >&2\n',3290 '#!/bin/sh\necho "hook: start" >&2\nsleep 0.05\necho "hook: end" >&2\n',
3283 { mode: 0o755 },3291 { mode: 0o755 },
3284 );3292 );
@@ -3339,9 +3347,9 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 54 unmodified lines
3339 Effect.gen(function* () {3347 Effect.gen(function* () {
3340 const repoDir = yield* makeTempDir("t3code-git-manager-");3348 const repoDir = yield* makeTempDir("t3code-git-manager-");
3341 yield* initRepo(repoDir);3349 yield* initRepo(repoDir);
3342 fs.writeFileSync(path.join(repoDir, "hook-failure.txt"), "broken\n");3350 NodeFS.writeFileSync(NodePath.join(repoDir, "hook-failure.txt"), "broken\n");
3343 fs.writeFileSync(3351 NodeFS.writeFileSync(
3344 path.join(repoDir, ".git", "hooks", "pre-commit"),3352 NodePath.join(repoDir, ".git", "hooks", "pre-commit"),
3345 '#!/bin/sh\necho "hook: fail" >&2\nexit 1\n',3353 '#!/bin/sh\necho "hook: fail" >&2\nexit 1\n',
3346 { mode: 0o755 },3354 { mode: 0o755 },
3347 );3355 );
@@ -3392,7 +3400,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { · 44 unmodified lines
3392 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-only-follow-up"]);3400 yield* runGit(repoDir, ["checkout", "-b", "feature/pr-only-follow-up"]);
3393 const remoteDir = yield* createBareRemote();3401 const remoteDir = yield* createBareRemote();
3394 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);3402 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
3395 fs.writeFileSync(path.join(repoDir, "pr-only.txt"), "pr only\n");3403 NodeFS.writeFileSync(NodePath.join(repoDir, "pr-only.txt"), "pr only\n");
3396 yield* runGit(repoDir, ["add", "pr-only.txt"]);3404 yield* runGit(repoDir, ["add", "pr-only.txt"]);
3397 yield* runGit(repoDir, ["commit", "-m", "PR only branch"]);3405 yield* runGit(repoDir, ["commit", "-m", "PR only branch"]);
3398 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-only-follow-up"]);3406 yield* runGit(repoDir, ["push", "-u", "origin", "feature/pr-only-follow-up"]);
apps/server/src/git/Utils.ts+3−3
@@ -1,7 +1,7 @@
1// @effect-diagnostics nodeBuiltinImport:off1// @effect-diagnostics nodeBuiltinImport:off
2import { existsSync } from "node:fs";2import * as NodeFS from "node:fs";
3import { join } from "node:path";3import * as NodePath from "node:path";
4 4
5export function isGitRepository(cwd: string): boolean {5export function isGitRepository(cwd: string): boolean {
6 return existsSync(join(cwd, ".git"));6 return NodeFS.existsSync(NodePath.join(cwd, ".git"));
7}7}