diff --git a/pkg/commands/git.go b/pkg/commands/git.go index e306efe13..bd834e574 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -508,12 +508,6 @@ func (c *GitCommand) Checkout(branch string, force bool) error { return c.OSCommand.RunCommand(fmt.Sprintf("git checkout %s %s", forceArg, branch)) } -// AddPatch prepares a subprocess for adding a patch by patch -// this will eventually be swapped out for a better solution inside the Gui -func (c *GitCommand) AddPatch(filename string) *exec.Cmd { - return c.OSCommand.PrepareSubProcess("git", "add", "--patch", c.OSCommand.Quote(filename)) -} - // PrepareCommitSubProcess prepares a subprocess for `git commit` func (c *GitCommand) PrepareCommitSubProcess() *exec.Cmd { return c.OSCommand.PrepareSubProcess("git", "commit") diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index 4329632a7..f73d84cdb 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -264,25 +264,6 @@ func (gui *Gui) handleStageAll(g *gocui.Gui, v *gocui.View) error { return gui.handleFileSelect(g, v, false) } -func (gui *Gui) handleAddPatch(g *gocui.Gui, v *gocui.View) error { - file, err := gui.getSelectedFile(g) - if err != nil { - if err == gui.Errors.ErrNoFiles { - return nil - } - return err - } - if !file.HasUnstagedChanges { - return gui.createErrorPanel(g, gui.Tr.SLocalize("FileHasNoUnstagedChanges")) - } - if !file.Tracked { - return gui.createErrorPanel(g, gui.Tr.SLocalize("CannotGitAdd")) - } - - gui.SubProcess = gui.GitCommand.AddPatch(file.Name) - return gui.Errors.ErrSubProcess -} - func (gui *Gui) handleIgnoreFile(g *gocui.Gui, v *gocui.View) error { file, err := gui.getSelectedFile(g) if err != nil { diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index fadf0c0c6..4bd28c74c 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -253,12 +253,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Modifier: gocui.ModNone, Handler: gui.handleStageAll, Description: gui.Tr.SLocalize("toggleStagedAll"), - }, { - ViewName: "files", - Key: 't', - Modifier: gocui.ModNone, - Handler: gui.handleAddPatch, - Description: gui.Tr.SLocalize("addPatch"), }, { ViewName: "files", Key: 'D', diff --git a/pkg/i18n/dutch.go b/pkg/i18n/dutch.go index bd3f77a09..43b36a8f0 100644 --- a/pkg/i18n/dutch.go +++ b/pkg/i18n/dutch.go @@ -109,9 +109,6 @@ func addDutch(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "pull", Other: "pull", - }, &i18n.Message{ - ID: "addPatch", - Other: "bewerkingen toevoegen", }, &i18n.Message{ ID: "edit", Other: "bewerken", diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index cf60bcb1a..856fd7d85 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -132,9 +132,6 @@ func addEnglish(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "pull", Other: "pull", - }, &i18n.Message{ - ID: "addPatch", - Other: "add patch", }, &i18n.Message{ ID: "edit", Other: "edit", diff --git a/pkg/i18n/polish.go b/pkg/i18n/polish.go index 0c90d7c2c..21c1f2231 100644 --- a/pkg/i18n/polish.go +++ b/pkg/i18n/polish.go @@ -101,9 +101,6 @@ func addPolish(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "refresh", Other: "odśwież", - }, &i18n.Message{ - ID: "addPatch", - Other: "dodaj łatkę", }, &i18n.Message{ ID: "edit", Other: "edytuj",