1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

add option to force delete given branch

This commit is contained in:
Rob Bast
2018-08-15 15:02:01 +02:00
parent 64cf8f5b10
commit 8e3df6b981
6 changed files with 27 additions and 4 deletions

View File

@ -223,8 +223,14 @@ func (c *GitCommand) NewBranch(name string) error {
}
// DeleteBranch delete branch
func (c *GitCommand) DeleteBranch(branch string) error {
return c.OSCommand.RunCommand("git branch -d " + branch)
func (c *GitCommand) DeleteBranch(branch string, force bool) error {
var command string
if force {
command = "git branch -D "
} else {
command = "git branch -d "
}
return c.OSCommand.RunCommand(command + branch)
}
// ListStash list stash