MCPcopy Create free account
hub / github.com/SIMARSINGHRAYAT/Gitzo / deleteBranch

Function deleteBranch

src/utils/github.ts:574–590  ·  view source on GitHub ↗
(
  token: string,
  owner: string,
  repo: string,
  branchName: string
)

Source from the content-addressed store, hash-verified

572 * Delete a branch after merge (cleanup).
573 */
574export async function deleteBranch(
575 token: string,
576 owner: string,
577 repo: string,
578 branchName: string
579): Promise<boolean> {
580 try {
581 const res = await ghFetch(
582 `/repos/${owner}/${repo}/git/refs/heads/${encodeURIComponent(branchName)}`,
583 token,
584 { method: 'DELETE' }
585 );
586 return res.ok || res.status === 422;
587 } catch {
588 return false;
589 }
590}
591
592// ══════════════════════════════════════════════════════════════════════
593// ── Galaxy Brain (GitHub Discussions via GraphQL API) ──

Callers 3

startYOLOBadgeWorkflowFunction · 0.90
startCreatingPRsFunction · 0.90
startCreatingPairsFunction · 0.90

Calls 1

ghFetchFunction · 0.85

Tested by

no test coverage detected