MCPcopy
hub / github.com/kptdev/kpt / DeleteBranch

Method DeleteBranch

internal/testutil/testutil.go:262–272  ·  view source on GitHub ↗

DeleteBranch deletes the git branch in the repo

(branch string)

Source from the content-addressed store, hash-verified

260
261// DeleteBranch deletes the git branch in the repo
262func (g *TestGitRepo) DeleteBranch(branch string) error {
263 // checkout the branch
264 cmd := exec.Command("git", []string{"branch", "-D", branch}...)
265 cmd.Dir = g.RepoDirectory
266 _, err := cmd.Output()
267 if err != nil {
268 return err
269 }
270
271 return nil
272}
273
274// Commit performs a git commit
275func (g *TestGitRepo) Commit(message string) error {

Callers 2

TestGitUtil_DefaultRefFunction · 0.80

Calls 1

CommandMethod · 0.45

Tested by 2

TestGitUtil_DefaultRefFunction · 0.64