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 | |
parent | b4a350259d3499f0c251651ad59dff97a86f02dd (diff) |
tell users we're going to reset submodules
-rw-r--r-- | pkg/gui/workspace_reset_options_panel.go | 9 | ||||
-rw-r--r-- | pkg/i18n/english.go | 3 |
2 files changed, 11 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 { diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index f34e74748..afce1cffd 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -1194,6 +1194,9 @@ func addEnglish(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "submoduleStashAndReset", Other: "stash uncommitted submodule changes and reset", + }, &i18n.Message{ + ID: "andResetSubmodules", + Other: "and reset submodules", }, ) } |