branchingCodebase

tcmts.studio.branchingCodebase · #brat6wlp · term · runs on the server

uses tcmts.share.servedCodebase, which uses process

The codebase, for what the studio does with its branches (make, switch to, merge, delete one): only the studio's maintainer does, whichever branch this browser reads (it's the one they act on).

import type { Codebase } from "#codebase/tcmts/cli/codebase";
import { HttpError } from "#codebase/tcmts/server";
import { callerNow, servedCodebase } from "#codebase/tcmts/share";

export function branchingCodebase(): Codebase {
  const { cb } = servedCodebase();
  if (callerNow(cb)?.role !== "maintainer")
    throw new HttpError(403, "Only the studio's maintainer changes the codebase.");
  return cb;
}

uses

used by