mirror of
https://github.com/go-gitea/git.git
synced 2026-07-19 14:33:37 -04:00
Fix branch deletion with git < 2.5.0 (#77)
This commit is contained in:
+4
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user