Skip to content

Commit 250836d

Browse files
fix(server): probe SSH configuration from the repository root
1 parent 05e35a9 commit 250836d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/server/src/project/RepositoryIdentityResolver.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
309309
expect(input.args).toEqual(["-G", "-l", "git", "-p", "2222", "review"]);
310310
expect(Duration.toMillis(Duration.fromInputUnsafe(input.timeout!))).toBe(5_000);
311311
expect(input.timeoutBehavior).toBe("timedOutResult");
312-
return Effect.succeed(processOutput("hostname gitlab.com\nuser git\nport 2222\n"));
312+
const hostname = input.cwd === "/repo" ? "gitlab.com" : "github.com";
313+
return Effect.succeed(processOutput(`hostname ${hostname}\nuser git\nport 2222\n`));
313314
});
314315
expect(identity?.canonicalKey).toBe("gitlab.com/team/app");
315316
expect(identity?.provider).toBe("gitlab");

‎apps/server/src/project/sshHostAlias.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ const readSshConfig = Effect.fn("sshHostAlias.readSshConfig")(function* (
8686
const result = yield* processRunner
8787
.run({
8888
command: "ssh",
89+
cwd,
8990
args: [
9091
"-G",
9192
...(remote.user ? ["-l", remote.user] : []),

0 commit comments

Comments
 (0)