From 810cc3b0689dbe681f4b8e3f52eb8a191aa71e8f Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 13 Nov 2026 01:19:24 +0000 Subject: [PATCH 1/2] test(server): remote status keeps a local upstream named without a slash Reproduces #35752: statusDetailsRemote drops upstreamRef and the behind count when the branch tracks a local branch such as main. Co-Authored-By: Claude Opus 5.5 --- apps/server/src/vcs/GitVcsDriverCore.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/apps/server/src/vcs/GitVcsDriverCore.test.ts b/apps/server/src/vcs/GitVcsDriverCore.test.ts index fba2a96d5f7f3..677ebb59ae0a7 100644 --- a/apps/server/src/vcs/GitVcsDriverCore.test.ts +++ b/apps/server/src/vcs/GitVcsDriverCore.test.ts @@ -3873,6 +3873,25 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => { }), ); + it.effect("reports a local upstream without a slash and its divergence", () => + Effect.gen(function* () { + const cwd = yield* makeTmpDir(); + yield* initRepoWithCommit(cwd); + const initialBranch = yield* git(cwd, ["symbolic-ref", "--short", "HEAD"]); + yield* git(cwd, ["branch", "feature"]); + yield* git(cwd, ["commit", "--allow-empty", "-m", "advance base"]); + yield* git(cwd, ["checkout", "feature"]); + yield* git(cwd, ["branch", `--set-upstream-to=${initialBranch}`]); + const driver = yield* GitVcsDriver.GitVcsDriver; + + const remoteStatus = yield* driver.statusDetailsRemote(cwd, { refreshUpstream: false }); + assert.equal(remoteStatus.upstreamRef, initialBranch); + assert.equal(remoteStatus.hasUpstream, true); + assert.equal(remoteStatus.aheadCount, 0); + assert.equal(remoteStatus.behindCount, 1); + }), + ); + it.effect("does not open a project folder laid out as a bare repository", () => Effect.gen(function* () { const cwd = yield* makeTmpDir(); From 1b6b241b44b5286d9c7363863ce5a4032bd70441 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 13 Nov 2026 01:24:25 +0000 Subject: [PATCH 2/2] fix(server): remote status keeps a local upstream named without a slash statusDetailsRemote passed the upstream from readCurrentUpstreamRef (already stripped of refs/heads/ or refs/remotes/) through a remote/branch parser, so a local upstream such as main came back null and the status dropped the upstream and its divergence. Use the ref as read. Fixes pingdotgg/t3code#35752 Co-Authored-By: Claude Opus 5.5 --- apps/server/src/vcs/GitVcsDriverCore.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/server/src/vcs/GitVcsDriverCore.ts b/apps/server/src/vcs/GitVcsDriverCore.ts index ee1f7bb9cdd06..e183c4958993e 100644 --- a/apps/server/src/vcs/GitVcsDriverCore.ts +++ b/apps/server/src/vcs/GitVcsDriverCore.ts @@ -2098,10 +2098,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* branch = branchNameFromHeadRef(branchResult.stdout); } const currentUpstreamRef = yield* readCurrentUpstreamRef(cwd); - let upstreamRef = - currentUpstreamRef === null - ? null - : (parseUpstreamRefByFirstSeparator(currentUpstreamRef)?.upstreamRef ?? null); + let upstreamRef = currentUpstreamRef; // Trimming a remote that starts with Unicode whitespace can leave a leading slash. if (currentUpstreamRef?.startsWith("/")) { upstreamRef = (yield* resolveCurrentUpstream(cwd, currentUpstreamRef))?.upstreamRef ?? null;