Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): recognize partial-clone remote annotations #16316

Mergedmaxwellyoung(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/16316/headmerged by juliusmarminge View on GitHub

Showing 10 changed files with 58 additions and 1 deletion (loading 7).

x
0 of 10 viewed, 10 left
24 additions and 0 deletionsapps/server/src/project/RepositoryIdentityResolver.test.tsModified
View file
@@ -203,6 +203,30 @@
}).pipe(Effect.provide(RepositoryIdentityResolver.layer)),
​
+ it.effect("resolves the fetch remote of a partial clone", () =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const cwd = yield* fileSystem.makeTempDirectoryScoped({
+ prefix: "t3-repository-identity-partial-clone-test-",
+ });
+​
+ yield* git(cwd, ["init"]);
+ yield* git(cwd, ["remote", "add", "origin", "git@github.com:T3Tools/t3code.git"]);
+ yield* git(cwd, ["remote", "set-url", "--push", "origin", "git@github.com:T3Tools/push.git"]);
+ yield* git(cwd, ["config", "remote.origin.promisor", "true"]);
+ yield* git(cwd, ["config", "remote.origin.partialclonefilter", "blob:none"]);
+​
+ const remotes = yield* git(cwd, ["remote", "-v"]);
+ expect(remotes.stdout).toContain("(fetch) [blob:none]");
+​
+ const resolver = yield* RepositoryIdentityResolver.RepositoryIdentityResolver;
+ const identity = yield* resolver.resolve(cwd);
+ expect(identity?.canonicalKey).toBe("github.com/t3tools/t3code");
+ expect(identity?.locator.remoteUrl).toBe("git@github.com:T3Tools/t3code.git");
+ expect(identity?.locator.remoteName).toBe("origin");
+ }).pipe(Effect.provide(RepositoryIdentityResolver.layer)),
+ );
+​
it.effect("returns the git top-level root path when resolving from a nested workspace", () =>
Effect.gen(function* () {