Skip to content

Commit 8cfdbcf

Browse files
fix(server): automatic pulls and pull request refresh let slow checkouts finish
pullCurrentBranch and refreshCheckedOutBranch ran their checkout-moving git commands under a 30-second deadline. A checkout held up by a slow smudge filter was killed partway, leaving a half-updated working tree that blocked the next pull. Run them without a deadline, as switchRef and worktree add already do. Fixes #34985 AI-assisted; verified with the tests and tools listed above.
1 parent 7a5cee3 commit 8cfdbcf

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

‎apps/server/src/vcs/GitVcsDriverCore.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,11 +1196,11 @@ describe("pullCurrentBranch", () => {
11961196
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
11971197
);
11981198

1199-
const moving = yield* (
1199+
const move =
12001200
subcommand === "pull"
1201-
? driver.pullCurrentBranch(cwd)
1202-
: driver.refreshCheckedOutBranch({ cwd, targetCommit: remoteHead })
1203-
).pipe(Effect.forkChild({ startImmediately: true }));
1201+
? Effect.asVoid(driver.pullCurrentBranch(cwd))
1202+
: Effect.asVoid(driver.refreshCheckedOutBranch({ cwd, targetCommit: remoteHead }));
1203+
const moving = yield* move.pipe(Effect.forkChild({ startImmediately: true }));
12041204
yield* Deferred.await(checkoutStarted);
12051205
yield* TestClock.adjust("60 seconds");
12061206
yield* Deferred.succeed(releaseCheckout, undefined);

‎apps/server/src/vcs/GitVcsDriverCore.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2984,8 +2984,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
29842984
// After a successful pull, HEAD before and after decides the result, so its output is not
29852985
// needed. A large fast-forward's diffstat can exceed the output cap, which must not fail a
29862986
// pull Git applied.
2987+
// A deadline would kill git mid-checkout (e.g. a slow LFS smudge) and strand a half-updated tree.
29872988
const options = {
2988-
timeoutMs: 30_000,
2989+
timeoutMs: null,
29892990
appendTruncationMarker: true,
29902991
allowNonZeroExit: true,
29912992
};
@@ -4773,7 +4774,8 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
47734774
? ["merge", "--ff-only", input.targetCommit]
47744775
: ["reset", "--merge", input.targetCommit],
47754776
{
4776-
timeoutMs: 30_000,
4777+
// Killing a slow checkout partway through strands a half-updated working tree.
4778+
timeoutMs: null,
47774779
fallbackErrorDetail: "git failed to move the checkout onto the pull request head",
47784780
},
47794781
);

0 commit comments

Comments
 (0)