diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-02-13 17:13:09 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | eab00de273590a3bef5c76e7a4484c7840073f47 (patch) | |
tree | fed5dc381452eaa0b07258715c80483353f627c7 /pkg/gui/reflog_panel.go | |
parent | 371b8d638b55ecce5c99700072051a9d15df7d96 (diff) |
reflog controller
Diffstat (limited to 'pkg/gui/reflog_panel.go')
-rw-r--r-- | pkg/gui/reflog_panel.go | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/pkg/gui/reflog_panel.go b/pkg/gui/reflog_panel.go index e45210fdf..f13783fbd 100644 --- a/pkg/gui/reflog_panel.go +++ b/pkg/gui/reflog_panel.go @@ -1,12 +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) reflogCommitsRenderToMain() error { commit := gui.State.Contexts.ReflogCommits.GetSelected() var task updateTask @@ -25,62 +18,3 @@ func (gui *Gui) reflogCommitsRenderToMain() error { }, }) } - -func (gui *Gui) CheckoutReflogCommit() error { - commit := gui.State.Contexts.ReflogCommits.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.CheckoutReflogCommit) - return gui.helpers.Refs.CheckoutRef(commit.Sha, types.CheckoutRefOptions{}) - }, - }) - if err != nil { - return err - } - - return nil -} - -func (gui *Gui) handleCreateReflogResetMenu() error { - commit := gui.State.Contexts.ReflogCommits.GetSelected() - - return gui.helpers.Refs.CreateGitResetMenu(commit.Sha) -} - -func (gui *Gui) handleViewReflogCommitFiles() error { - commit := gui.State.Contexts.ReflogCommits.GetSelected() - if commit == nil { - return nil - } - - return gui.SwitchToCommitFilesContext(controllers.SwitchToCommitFilesContextOpts{ - RefName: commit.Sha, - CanRebase: false, - Context: gui.State.Contexts.ReflogCommits, - }) -} - -func (gui *Gui) handleCopyReflogCommit() error { - commit := gui.State.Contexts.ReflogCommits.GetSelected() - if commit == nil { - return nil - } - - return gui.helpers.CherryPick.Copy(commit, gui.State.Model.FilteredReflogCommits, gui.State.Contexts.ReflogCommits) -} - -func (gui *Gui) handleCopyReflogCommitRange() error { - // just doing this to ensure something is selected - commit := gui.State.Contexts.ReflogCommits.GetSelected() - if commit == nil { - return nil - } - - return gui.helpers.CherryPick.CopyRange(gui.State.Contexts.ReflogCommits.GetSelectedLineIdx(), gui.State.Model.FilteredReflogCommits, gui.State.Contexts.ReflogCommits) -} |