diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-02-13 17:24:37 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | 1253100431a93dca4b4953f2d4bfe73d22e15645 (patch) | |
tree | e0a7f8118b740ea162a5ff482b3172fdd07e5671 /pkg/gui/sub_commits_panel.go | |
parent | eab00de273590a3bef5c76e7a4484c7840073f47 (diff) |
cleanup
Diffstat (limited to 'pkg/gui/sub_commits_panel.go')
-rw-r--r-- | pkg/gui/sub_commits_panel.go | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/pkg/gui/sub_commits_panel.go b/pkg/gui/sub_commits_panel.go index 0d39038d4..b79e890b9 100644 --- a/pkg/gui/sub_commits_panel.go +++ b/pkg/gui/sub_commits_panel.go @@ -1,10 +1,5 @@ package gui -import ( - "github.com/jesseduffield/lazygit/pkg/gui/controllers" - "github.com/jesseduffield/lazygit/pkg/gui/types" -) - // list panel functions func (gui *Gui) subCommitsRenderToMain() error { @@ -25,73 +20,3 @@ func (gui *Gui) subCommitsRenderToMain() error { }, }) } - -func (gui *Gui) handleCheckoutSubCommit() error { - commit := gui.State.Contexts.SubCommits.GetSelected() - if commit == nil { - return nil - } - - err := gui.c.Ask(types.AskOpts{ - Title: gui.c.Tr.LcCheckoutCommit, - Prompt: gui.c.Tr.SureCheckoutThisCommit, - HandleConfirm: func() error { - gui.c.LogAction(gui.c.Tr.Actions.CheckoutCommit) - return gui.helpers.Refs.CheckoutRef(commit.Sha, types.CheckoutRefOptions{}) - }, - }) - if err != nil { - return err - } - - gui.State.Contexts.SubCommits.SetSelectedLineIdx(0) - - return nil -} - -func (gui *Gui) handleCreateSubCommitResetMenu() error { - commit := gui.State.Contexts.SubCommits.GetSelected() - - return gui.helpers.Refs.CreateGitResetMenu(commit.Sha) -} - -func (gui *Gui) handleViewSubCommitFiles() error { - commit := gui.State.Contexts.SubCommits.GetSelected() - if commit == nil { - return nil - } - - return gui.SwitchToCommitFilesContext(controllers.SwitchToCommitFilesContextOpts{ - RefName: commit.Sha, - CanRebase: false, - Context: gui.State.Contexts.SubCommits, - }) -} - -func (gui *Gui) handleNewBranchOffSubCommit() error { - commit := gui.State.Contexts.SubCommits.GetSelected() - if commit == nil { - return nil - } - - return gui.helpers.Refs.NewBranch(commit.RefName(), commit.Description(), "") -} - -func (gui *Gui) handleCopySubCommit() error { - commit := gui.State.Contexts.SubCommits.GetSelected() - if commit == nil { - return nil - } - - return gui.helpers.CherryPick.Copy(commit, gui.State.Model.SubCommits, gui.State.Contexts.SubCommits) -} - -func (gui *Gui) handleCopySubCommitRange() error { - // just doing this to ensure something is selected - commit := gui.State.Contexts.SubCommits.GetSelected() - if commit == nil { - return nil - } - - return gui.helpers.CherryPick.CopyRange(gui.State.Contexts.SubCommits.GetSelectedLineIdx(), gui.State.Model.SubCommits, gui.State.Contexts.SubCommits) -} |