MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / DeleteBranch

Function DeleteBranch

internal/git/push.go:78–85  ·  view source on GitHub ↗

DeleteBranch deletes a local branch.

(repoDir, branch string)

Source from the content-addressed store, hash-verified

76
77// DeleteBranch deletes a local branch.
78func DeleteBranch(repoDir, branch string) error {
79 cmd := exec.Command("git", "branch", "-D", branch)
80 cmd.Dir = repoDir
81 if out, err := cmd.CombinedOutput(); err != nil {
82 return fmt.Errorf("failed to delete branch: %s", strings.TrimSpace(string(out)))
83 }
84 return nil
85}

Callers 2

TestDeleteBranchFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestDeleteBranchFunction · 0.68