summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorRob Bast <rob.bast@gmail.com>2018-08-15 15:02:01 +0200
committerRob Bast <rob.bast@gmail.com>2018-08-20 08:37:16 +0200
commit8e3df6b981c8d501fcaecf6689aa7f78c25920fa (patch)
tree3675bb17fd2a1e064114a724f75825956170762c /pkg/commands
parent64cf8f5b107a310e6729b68ba8d7638effd3966d (diff)
add option to force delete given branch
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 557e6a8c0..45219b5c0 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -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