From dd46b2b9fc3f82924077b734f36175093f8efb8d Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 1 Apr 2026 10:29:40 -0700 Subject: [PATCH] Stabilize overlapping remote tests across Git versions Co-authored-by: codex --- apps/server/src/git/Layers/GitCore.test.ts | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/apps/server/src/git/Layers/GitCore.test.ts b/apps/server/src/git/Layers/GitCore.test.ts index 97bca72756..60d0724204 100644 --- a/apps/server/src/git/Layers/GitCore.test.ts +++ b/apps/server/src/git/Layers/GitCore.test.ts @@ -59,14 +59,14 @@ function git( }); } -function addRemoteWithFetchNamespace( +function configureRemote( cwd: string, remoteName: string, remotePath: string, fetchNamespace: string, ): Effect.Effect { return Effect.gen(function* () { - yield* git(cwd, ["remote", "add", remoteName, remotePath]); + yield* git(cwd, ["config", `remote.${remoteName}.url`, remotePath]); return yield* git(cwd, [ "config", "--replace-all", @@ -746,13 +746,8 @@ it.layer(TestLayer)("git integration", (it) => { const defaultBranch = (yield* (yield* GitCore).listBranches({ cwd: source })).branches.find( (branch) => branch.current, )!.name; - yield* addRemoteWithFetchNamespace( - source, - prefixRemoteName, - prefixRemote, - prefixFetchNamespace, - ); - yield* git(source, ["remote", "add", remoteName, remote]); + yield* configureRemote(source, prefixRemoteName, prefixRemote, prefixFetchNamespace); + yield* configureRemote(source, remoteName, remote, remoteName); yield* git(source, ["push", "-u", remoteName, defaultBranch]); yield* git(source, ["checkout", "-b", featureBranch]); @@ -1694,13 +1689,8 @@ it.layer(TestLayer)("git integration", (it) => { yield* git(prefixRemote, ["init", "--bare"]); const { initialBranch } = yield* initRepoWithCommit(tmp); - yield* addRemoteWithFetchNamespace( - tmp, - prefixRemoteName, - prefixRemote, - prefixFetchNamespace, - ); - yield* git(tmp, ["remote", "add", remoteName, remote]); + yield* configureRemote(tmp, prefixRemoteName, prefixRemote, prefixFetchNamespace); + yield* configureRemote(tmp, remoteName, remote, remoteName); yield* git(tmp, ["push", "-u", remoteName, initialBranch]); yield* git(tmp, ["checkout", "-b", featureBranch]);