diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-29 18:16:40 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-29 18:21:59 +1000 |
commit | 6e80371535d13b455eb5cdf35adab810aa828a04 (patch) | |
tree | d35c0a3cf7e0b937d6721c2f3e28aa10da42615e /pkg/gui/workspace_reset_options_panel.go | |
parent | b4a350259d3499f0c251651ad59dff97a86f02dd (diff) |
tell users we're going to reset submodules
Diffstat (limited to 'pkg/gui/workspace_reset_options_panel.go')
-rw-r--r-- | pkg/gui/workspace_reset_options_panel.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/gui/workspace_reset_options_panel.go b/pkg/gui/workspace_reset_options_panel.go index 0899b5c98..93b33f56e 100644 --- a/pkg/gui/workspace_reset_options_panel.go +++ b/pkg/gui/workspace_reset_options_panel.go @@ -1,6 +1,8 @@ package gui import ( + "fmt" + "github.com/fatih/color" "github.com/jesseduffield/gocui" ) @@ -8,11 +10,16 @@ import ( func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { red := color.New(color.FgRed) + nukeStr := "reset --hard HEAD && git clean -fd" + if len(gui.State.SubmoduleConfigs) > 0 { + nukeStr = fmt.Sprintf("%s (%s)", nukeStr, gui.Tr.SLocalize("andResetSubmodules")) + } + menuItems := []*menuItem{ { displayStrings: []string{ gui.Tr.SLocalize("discardAllChangesToAllFiles"), - red.Sprint("reset --hard HEAD && git clean -fd"), + red.Sprint(nukeStr), }, onPress: func() error { if err := gui.GitCommand.ResetAndClean(); err != nil { |