The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 18:30 UTC
fix(server): remote status keeps a local upstream named without a slash (#35766)
Julius Marminge committed
Nov 12, 2026 at 17:38 UTC
a119af0079df0778a03c36708191240a4514f141
2 files changed
+20
-4
apps/server/src/vcs/GitVcsDriverCore.test.ts
+19
@@ -3873,6 +3873,25 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
3873
}),
3874
);
3875
3876
+ it.effect("reports a local upstream without a slash and its divergence", () =>
3877
+ Effect.gen(function* () {
3878
+ const cwd = yield* makeTmpDir();
3879
+ yield* initRepoWithCommit(cwd);
3880
+ const initialBranch = yield* git(cwd, ["symbolic-ref", "--short", "HEAD"]);
3881
+ yield* git(cwd, ["branch", "feature"]);
3882
+ yield* git(cwd, ["commit", "--allow-empty", "-m", "advance base"]);
3883
+ yield* git(cwd, ["checkout", "feature"]);
3884
+ yield* git(cwd, ["branch", `--set-upstream-to=${initialBranch}`]);
3885
+ const driver = yield* GitVcsDriver.GitVcsDriver;
3886
+
3887
+ const remoteStatus = yield* driver.statusDetailsRemote(cwd, { refreshUpstream: false });
3888
+ assert.equal(remoteStatus.upstreamRef, initialBranch);
3889
+ assert.equal(remoteStatus.hasUpstream, true);
3890
+ assert.equal(remoteStatus.aheadCount, 0);
3891
+ assert.equal(remoteStatus.behindCount, 1);
3892
+ }),
3893
+ );
3894
+
3895
it.effect("does not open a project folder laid out as a bare repository", () =>
3896
Effect.gen(function* () {
3897
const cwd = yield* makeTmpDir();
apps/server/src/vcs/GitVcsDriverCore.ts
+1
-4
@@ -2098,10 +2098,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
2098
branch = branchNameFromHeadRef(branchResult.stdout);
2099
}
2100
const currentUpstreamRef = yield* readCurrentUpstreamRef(cwd);
2101
- let upstreamRef =
2102
- currentUpstreamRef === null
2103
- ? null
2104
- : (parseUpstreamRefByFirstSeparator(currentUpstreamRef)?.upstreamRef ?? null);
2101
+ let upstreamRef = currentUpstreamRef;
2102
// Trimming a remote that starts with Unicode whitespace can leave a leading slash.
2103
if (currentUpstreamRef?.startsWith("/")) {
2104
upstreamRef = (yield* resolveCurrentUpstream(cwd, currentUpstreamRef))?.upstreamRef ?? null;