Fix branch deletion with git < 2.5.0 (#77)

This commit is contained in:
Lauris BH
2017-08-03 03:53:29 +03:00
committed by Bo-Yi Wu
parent fc63966893
commit 479f87e5d1
+4 -2
View File
@@ -86,10 +86,12 @@ type DeleteBranchOptions struct {
// DeleteBranch delete a branch by name on repository.
func (repo *Repository) DeleteBranch(name string, opts DeleteBranchOptions) error {
cmd := NewCommand("branch", "-d")
cmd := NewCommand("branch")
if opts.Force {
cmd.AddArguments("-f")
cmd.AddArguments("-D")
} else {
cmd.AddArguments("-d")
}
cmd.AddArguments(name)