diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-29 18:36:54 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-29 20:48:49 +1000 |
commit | 630e4469898cb630c93cd309156c7c90bf2acd75 (patch) | |
tree | 553d9ac059b8d75190821db9c053d8c12f4f02e6 /pkg/gui/commits_panel.go | |
parent | 44248d9ab0818dfca6a5c1f5ee2ad5b0d45d4998 (diff) |
move commits model into models package
Diffstat (limited to 'pkg/gui/commits_panel.go')
-rw-r--r-- | pkg/gui/commits_panel.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index 541ab465e..4259fb1a2 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -5,11 +5,12 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" + "github.com/jesseduffield/lazygit/pkg/models" ) // list panel functions -func (gui *Gui) getSelectedLocalCommit() *commands.Commit { +func (gui *Gui) getSelectedLocalCommit() *models.Commit { selectedLine := gui.State.Panels.Commits.SelectedLineIdx if selectedLine == -1 { return nil @@ -443,7 +444,7 @@ func (gui *Gui) handleViewCommitFiles() error { return gui.switchToCommitFilesContext(commit.Sha, true, gui.Contexts.BranchCommits.Context, "commits") } -func (gui *Gui) hasCommit(commits []*commands.Commit, target string) (int, bool) { +func (gui *Gui) hasCommit(commits []*models.Commit, target string) (int, bool) { for idx, commit := range commits { if commit.Sha == target { return idx, true @@ -452,7 +453,7 @@ func (gui *Gui) hasCommit(commits []*commands.Commit, target string) (int, bool) return -1, false } -func (gui *Gui) unchooseCommit(commits []*commands.Commit, i int) []*commands.Commit { +func (gui *Gui) unchooseCommit(commits []*models.Commit, i int) []*models.Commit { return append(commits[:i], commits[i+1:]...) } |