Skip to content

Commit 6e79ab7

Browse files
MarcoDotIOclaude
andcommitted
fix(server): a never-pushed branch tracking a local branch gets the unpublished-branch guard
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3859214 commit 6e79ab7

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎apps/server/src/git/GitManager.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,6 +2597,18 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
25972597
updatedAt: "2026-05-01T10:00:00Z",
25982598
},
25992599
],
2600+
// Someone else's branch of the same name; this one was never pushed.
2601+
"feature/local-base": [
2602+
{
2603+
number: 62,
2604+
title: "Another local base",
2605+
url: "https://github.com/pingdotgg/codething-mvp/pull/62",
2606+
baseRefName: "main",
2607+
headRefName: "feature/local-base",
2608+
state: "open",
2609+
updatedAt: "2026-05-01T10:00:00Z",
2610+
},
2611+
],
26002612
},
26012613
},
26022614
});

‎apps/server/src/git/GitManager.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ export const make = Effect.gen(function* () {
12381238
}
12391239
if (
12401240
details.localBranchExists &&
1241-
details.upstreamRef === null &&
1241+
(details.upstreamRef === null || headContext.remoteName === null) &&
12421242
(yield* isUnpublishedBranch(cwd, headContext))
12431243
) {
12441244
return { latest: null, headContext };
@@ -1845,7 +1845,7 @@ export const make = Effect.gen(function* () {
18451845
],
18461846
{ concurrency: "unbounded" },
18471847
);
1848-
if (configuredRemote !== null && configuredMerge !== null) {
1848+
if (configuredRemote !== null && configuredRemote !== "." && configuredMerge !== null) {
18491849
return false;
18501850
}
18511851

0 commit comments

Comments
 (0)