Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a git failure caused by a missing ref now says so #17794

Mergedtris203(GitHub profile, opens in a new tab)merged 9 commits intomain fromrefs/pull/17794/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 126 additions and 7 deletions (loading 1).

x
0 of 4 viewed, 4 left
82 additions and 0 deletionsapps/server/src/vcs/GitVcsDriverCore.test.tsModified
View file
@@ -1269,6 +1269,88 @@
+ it.effect.each([
+ { action: "worktree add", detail: "git worktree add failed" },
+ { action: "switch", detail: "git checkout failed" },
+ ])(
+ "reports a missing ref during $action with stable, redacted diagnostics",
+ ({ action, detail }) =>
+ Effect.gen(function* () {
+ const cwd = yield* makeTmpDir();
+ yield* initRepoWithCommit(cwd);
+ const path = yield* Path.Path;
+ const refName = "private/deleted-base";
+ const locales: Array<string | undefined> = [];
+ const delegate = yield* ChildProcessSpawner.ChildProcessSpawner;
+ const spawner = ChildProcessSpawner.make((command) => {
+ if (
+ ChildProcess.isStandardCommand(command) &&
+ (command.args.includes("worktree") || command.args[0] === "checkout")
+ ) {
+ locales.push(command.options.env?.LC_ALL);
+ }
+ return delegate.spawn(command);
+ });
+ const driver = yield* makeGitVcsDriverCore().pipe(
+ Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
+ Effect.provide(layerServerConfig),
+ );