1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

Merge pull request #151 from alcohol/force-delete-branch

add option to force delete given branch
This commit is contained in:
Jesse Duffield
2018-08-21 23:45:27 +10:00
committed by GitHub
6 changed files with 42 additions and 7 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