From 5236c2aa7263bc6591ea6ee5ccdf1d53a3b00b33 Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 14 Nov 2026 14:57:27 +0100 Subject: [PATCH] gitea: the seat git's branch with no branch named answers the repository's default branch (A-399) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The seed and a registration with no branches read the default branch through the seat git (design 47 G-1 ยง104) by calling branch with an empty branch; gitea refused it as no branch for a path, and the seed stopped on novox 2026-11-14. --- modules/gitea/seat.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/gitea/seat.ts b/modules/gitea/seat.ts index 8cd08bd95..1c0c97124 100644 --- a/modules/gitea/seat.ts +++ b/modules/gitea/seat.ts @@ -152,7 +152,10 @@ export function seatTools(gitea: GiteaClient, deps: SeatDeps): ToolDefinition[] verb(GIT_VERBS.branch, "The seat git's branch: a branch's head, and whether a protection rule refuses a direct push and admits only merges.", async (args): Promise => { const { owner, repo, full } = repositoryOf(args.repository); - const branch = String(args.branch ?? ""); + // No branch named is the repository's default branch, read from the forge, as the verb file reads it (A-399). + let branch = String(args.branch ?? ""); + if (branch === "") branch = String((await gitea.getRepo(owner, repo)).default_branch ?? ""); + if (branch === "") throw new Error(`the forge names no default branch of ${full}`); // The head first: a branch the forge does not hold is its 404, the kind not-found, never an unprotected branch. const head = await gitea.branchHead(owner, repo, branch); return { repository: full, branch, head, protected: pushRefused(await gitea.appliedProtection(owner, repo, branch)) };