summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-25 11:02:46 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-25 11:02:46 +1000
commitf24c95aedec785985dfcd98ff3997152c193bd3e (patch)
tree9f8ac1a61cf686052f623b767e13d6d1a14e3683 /pkg/commands/git.go
parent5628eae502ee3b4d3d72a8e4045713b637f7a764 (diff)
parent93ab892bdd1226f9a519a938c8b28590e71e54f3 (diff)
Merge branch 'master' into feature/auto-updates
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r--pkg/commands/git.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index bf9aa6646..14f3a433a 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -7,7 +7,7 @@ import (
"os/exec"
"strings"
- "github.com/Sirupsen/logrus"
+ "github.com/sirupsen/logrus"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/utils"
gitconfig "github.com/tcnksm/go-gitconfig"
@@ -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