Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit 479f87e

Browse files
lafriksappleboy
authored andcommitted
Fix branch deletion with git < 2.5.0 (#77)
1 parent fc63966 commit 479f87e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

repo_branch.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ type DeleteBranchOptions struct {
8686

8787
// DeleteBranch delete a branch by name on repository.
8888
func (repo *Repository) DeleteBranch(name string, opts DeleteBranchOptions) error {
89-
cmd := NewCommand("branch", "-d")
89+
cmd := NewCommand("branch")
9090

9191
if opts.Force {
92-
cmd.AddArguments("-f")
92+
cmd.AddArguments("-D")
93+
} else {
94+
cmd.AddArguments("-d")
9395
}
9496

9597
cmd.AddArguments(name)

0 commit comments

Comments
 (0)