Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions pkg/commands/git_commands/deps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
gogit "github.com/jesseduffield/go-git/v5"
"github.com/jesseduffield/lazygit/pkg/commands/git_config"
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
"github.com/jesseduffield/lazygit/pkg/commands/patch"
"github.com/jesseduffield/lazygit/pkg/common"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/utils"
Expand Down Expand Up @@ -126,26 +125,6 @@ func buildWorkingTreeCommands(deps commonDeps) *WorkingTreeCommands {
return NewWorkingTreeCommands(gitCommon, submoduleCommands, fileLoader)
}

func buildPatchCommands(deps commonDeps) *PatchCommands { //nolint:golint,unused
gitCommon := buildGitCommon(deps)
rebaseCommands := buildRebaseCommands(deps)
commitCommands := buildCommitCommands(deps)
statusCommands := buildStatusCommands(deps)
stashCommands := buildStashCommands(deps)
loadFileFn := func(from string, to string, reverse bool, filename string, plain bool) (string, error) {
return "", nil
}
patchBuilder := patch.NewPatchBuilder(gitCommon.Log, loadFileFn)

return NewPatchCommands(gitCommon, rebaseCommands, commitCommands, statusCommands, stashCommands, patchBuilder)
}

func buildStatusCommands(deps commonDeps) *StatusCommands { //nolint:golint,unused
gitCommon := buildGitCommon(deps)

return NewStatusCommands(gitCommon)
}

func buildStashCommands(deps commonDeps) *StashCommands {
gitCommon := buildGitCommon(deps)
fileLoader := buildFileLoader(gitCommon)
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/basic_commits_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewBasicCommitsController(c *ControllerCommon, context ContainsCommits) *Ba
baseController: baseController{},
c: c,
context: context,
ListControllerTrait: NewListControllerTrait[*models.Commit](
ListControllerTrait: NewListControllerTrait(
c,
context,
context.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/bisect_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewBisectController(
return &BisectController{
baseController: baseController{},
c: c,
ListControllerTrait: NewListControllerTrait[*models.Commit](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().LocalCommits,
c.Contexts().LocalCommits.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/branches_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewBranchesController(
return &BranchesController{
baseController: baseController{},
c: c,
ListControllerTrait: NewListControllerTrait[*models.Branch](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().Branches,
c.Contexts().Branches.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/commits_files_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func NewCommitFilesController(
return &CommitFilesController{
baseController: baseController{},
c: c,
ListControllerTrait: NewListControllerTrait[*filetree.CommitFileNode](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().CommitFiles,
c.Contexts().CommitFiles.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/files_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewFilesController(
) *FilesController {
return &FilesController{
c: c,
ListControllerTrait: NewListControllerTrait[*filetree.FileNode](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().Files,
c.Contexts().Files.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/git_flow_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewGitFlowController(
) *GitFlowController {
return &GitFlowController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*models.Branch](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().Branches,
c.Contexts().Branches.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/local_commits_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewLocalCommitsController(
baseController: baseController{},
c: c,
pullFiles: pullFiles,
ListControllerTrait: NewListControllerTrait[*models.Commit](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().LocalCommits,
c.Contexts().LocalCommits.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/menu_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewMenuController(
) *MenuController {
return &MenuController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*types.MenuItem](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().Menu,
c.Contexts().Menu.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/reflog_commits_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func NewReflogCommitsController(
) *ReflogCommitsController {
return &ReflogCommitsController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*models.Commit](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().ReflogCommits,
c.Contexts().ReflogCommits.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/remote_branches_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewRemoteBranchesController(
) *RemoteBranchesController {
return &RemoteBranchesController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*models.RemoteBranch](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().RemoteBranches,
c.Contexts().RemoteBranches.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/remotes_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewRemotesController(
) *RemotesController {
return &RemotesController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*models.Remote](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().Remotes,
c.Contexts().Remotes.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/stash_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewStashController(
) *StashController {
return &StashController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*models.StashEntry](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().Stash,
c.Contexts().Stash.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/sub_commits_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewSubCommitsController(
) *SubCommitsController {
return &SubCommitsController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*models.Commit](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().SubCommits,
c.Contexts().SubCommits.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/submodules_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewSubmodulesController(
) *SubmodulesController {
return &SubmodulesController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*models.SubmoduleConfig](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().Submodules,
c.Contexts().Submodules.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/suggestions_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewSuggestionsController(
) *SuggestionsController {
return &SuggestionsController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*types.Suggestion](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().Suggestions,
c.Contexts().Suggestions.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/switch_to_sub_commits_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewSwitchToSubCommitsController(
) *SwitchToSubCommitsController {
return &SwitchToSubCommitsController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[types.Ref](
ListControllerTrait: NewListControllerTrait(
c,
context,
context.GetSelectedRef,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/tags_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewTagsController(
) *TagsController {
return &TagsController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*models.Tag](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().Tags,
c.Contexts().Tags.GetSelected,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/worktree_options_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type WorktreeOptionsController struct {
func NewWorktreeOptionsController(c *ControllerCommon, context CanViewWorktreeOptions) *WorktreeOptionsController {
return &WorktreeOptionsController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[string](
ListControllerTrait: NewListControllerTrait(
c,
context,
context.GetSelectedItemId,
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/worktrees_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewWorktreesController(
) *WorktreesController {
return &WorktreesController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[*models.Worktree](
ListControllerTrait: NewListControllerTrait(
c,
c.Contexts().Worktrees,
c.Contexts().Worktrees.GetSelected,
Expand Down