diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-25 11:02:46 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-25 11:02:46 +1000 |
commit | f24c95aedec785985dfcd98ff3997152c193bd3e (patch) | |
tree | 9f8ac1a61cf686052f623b767e13d6d1a14e3683 /pkg/commands/git.go | |
parent | 5628eae502ee3b4d3d72a8e4045713b637f7a764 (diff) | |
parent | 93ab892bdd1226f9a519a938c8b28590e71e54f3 (diff) |
Merge branch 'master' into feature/auto-updates
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r-- | pkg/commands/git.go | 12 |
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 |