branchFor

tcmts.cli.sync.branchFor · #6kyvnne2 · term · runs anywhere

The branch a contributor's local branch is pushed as: theirs, under @<handle>/.

import type { Caller } from "#codebase/tcmts/cli/sync";

export function branchFor(caller: Caller, local: string): string {
  if (caller.role !== "contributor") return local;
  const prefix = `@${caller.handle}/`;
  return local.startsWith(prefix) ? local : prefix + local;
}

uses

used by