Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): automatic pull no longer fast-forwards a branch switched to mid-pull #48235

Openjuliusmarmingewants to merge 2 commits intomain fromrefs/pull/48235/headopened View on GitHub

Showing 2 changed files with 100 additions and 6 deletions (loading 1).

x
0 of 2 viewed, 2 left
100 additions and 6 deletionsapps/server/src/vcs/GitVcsDriverCore.test.tsModified
View file
@@ -1512,7 +1512,7 @@
const handle = yield* delegate.spawn(command);
const isPull =
ChildProcess.isStandardCommand(command) &&
- command.args.includes("pull") &&
+ command.args[0] === "merge" &&
command.args.includes("--ff-only");
if (isPull) onPull?.(command.args.map(String));
return isPull
@@ -1572,7 +1572,11 @@
const spawner = ChildProcessSpawner.make((command) =>
Effect.gen(function* () {
const handle = yield* delegate.spawn(command);
- if (!ChildProcess.isStandardCommand(command) || !command.args.includes("fetch"))
+ // Pull's own fetch writes FETCH_HEAD; a status fetch does not.
+ if (
+ !ChildProcess.isStandardCommand(command) ||
+ !command.args.includes("--no-write-fetch-head")
+ )
return handle;
const commandCwd = String(command.options.cwd);
if (commandCwd === targetPath) targetFetches++;
@@ -1825,12 +1829,12 @@
Effect.gen(function* () {
if (!ChildProcess.isStandardCommand(command)) return yield* delegate.spawn(command);
const target = NodeFS.realpathSync.native(String(command.options.cwd)) === targetPath;
- if (target && command.args.includes("pull")) {
+ if (target && command.args[0] === "fetch") {