Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(source-control): remotes like github.com:owner/repo reach their host #29457

MergedMarcoDotIO(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/29457/headmerged by maria-rcks View on GitHub

Showing 12 changed files with 49 additions and 0 deletions (loading 9).

x
0 of 12 viewed, 12 left
19 additions and 0 deletionsapps/server/src/project/RepositoryIdentityResolver.test.tsModified
View file
@@ -51,6 +51,25 @@
}).pipe(Effect.provide(RepositoryIdentityResolver.layer)),
);
​
+ it.effect("identifies the host of an SSH remote that leaves its user to ssh config", () =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const cwd = yield* fileSystem.makeTempDirectoryScoped({
+ prefix: "t3-repository-identity-userless-remote-test-",
+ });
+​
+ yield* git(cwd, ["init"]);
+ yield* git(cwd, ["remote", "add", "origin", "github.com:T3Tools/t3code.git"]);
+​
+ const resolver = yield* RepositoryIdentityResolver.RepositoryIdentityResolver;
+ const identity = yield* resolver.resolve(cwd);
+​
+ expect(identity?.canonicalKey).toBe("github.com/t3tools/t3code");
+ expect(identity?.provider).toBe("github");
+ expect(identity?.displayName).toBe("T3Tools/t3code");
+ }).pipe(Effect.provide(RepositoryIdentityResolver.layer)),
+ );
+​
it.effect("resolves the fetch remote of a partial clone", () =>
Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
18 additions and 0 deletionsapps/server/src/sourceControl/SourceControlProviderRegistry.test.tsModified
View file