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:
@ -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
|
||||
|
Reference in New Issue
Block a user