Skip to content

Commit 143134f

Browse files
authored
Remove unused code and texts (#4715)
- **PR Description** Remove some unused code, in particular a lot of unused texts from the TranslationSet.
2 parents 5587d70 + 8f48ad7 commit 143134f

File tree

5 files changed

+192
-300
lines changed

5 files changed

+192
-300
lines changed

pkg/app/daemon/rebase.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,12 @@ import (
55
"path/filepath"
66
"strings"
77

8-
"github.com/jesseduffield/lazygit/pkg/commands/models"
98
"github.com/jesseduffield/lazygit/pkg/common"
109
"github.com/jesseduffield/lazygit/pkg/env"
1110
"github.com/jesseduffield/lazygit/pkg/utils"
12-
"github.com/samber/lo"
1311
"github.com/stefanhaller/git-todo-parser/todo"
1412
)
1513

16-
type TodoLine struct {
17-
Action string
18-
Commit *models.Commit
19-
}
20-
21-
func (self *TodoLine) ToString() string {
22-
if self.Action == "break" {
23-
return self.Action + "\n"
24-
}
25-
return self.Action + " " + self.Commit.Hash() + " " + self.Commit.Name + "\n"
26-
}
27-
28-
func TodoLinesToString(todoLines []TodoLine) string {
29-
lines := lo.Map(todoLines, func(todoLine TodoLine, _ int) string {
30-
return todoLine.ToString()
31-
})
32-
33-
return strings.Join(lo.Reverse(lines), "")
34-
}
35-
3614
type ChangeTodoAction struct {
3715
Hash string
3816
NewAction todo.TodoCommand

pkg/commands/oscommands/cmd_obj_builder.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ func (self *CmdObjBuilder) CloneWithNewRunner(decorate func(ICmdObjRunner) ICmdO
7979
}
8080
}
8181

82-
const CHARS_REQUIRING_QUOTES = "\"\\$` "
83-
84-
// If you update this method, be sure to update CHARS_REQUIRING_QUOTES
8582
func (self *CmdObjBuilder) Quote(message string) string {
8683
var quote string
8784
if self.platform.OS == "windows" {

pkg/gui/context_config.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ func (gui *Gui) contextTree() *context.ContextTree {
1313
return context.NewContextTree(contextCommon)
1414
}
1515

16-
// using this wrapper for when an onFocus function doesn't care about any potential
17-
// props that could be passed
18-
func OnFocusWrapper(f func() error) func(opts types.OnFocusOpts) error {
19-
return func(opts types.OnFocusOpts) error {
20-
return f()
21-
}
22-
}
23-
2416
func (gui *Gui) defaultSideContext() types.Context {
2517
if gui.State.Modes.Filtering.Active() {
2618
return gui.State.Contexts.LocalCommits

pkg/gui/controllers/commits_files_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ func (self *CommitFilesController) openDiffTool(node *filetree.CommitFileNode) e
379379

380380
func (self *CommitFilesController) toggleForPatch(selectedNodes []*filetree.CommitFileNode) error {
381381
if self.c.AppState.DiffContextSize == 0 {
382-
return fmt.Errorf(self.c.Tr.Actions.NotEnoughContextToStage,
382+
return fmt.Errorf(self.c.Tr.Actions.NotEnoughContextForCustomPatch,
383383
keybindings.Label(self.c.UserConfig().Keybinding.Universal.IncreaseContextInDiffView))
384384
}
385385

@@ -475,7 +475,7 @@ func (self *CommitFilesController) enterCommitFile(node *filetree.CommitFileNode
475475
}
476476

477477
if self.c.AppState.DiffContextSize == 0 {
478-
return fmt.Errorf(self.c.Tr.Actions.NotEnoughContextToStage,
478+
return fmt.Errorf(self.c.Tr.Actions.NotEnoughContextForCustomPatch,
479479
keybindings.Label(self.c.UserConfig().Keybinding.Universal.IncreaseContextInDiffView))
480480
}
481481

0 commit comments

Comments
 (0)