summaryrefslogtreecommitdiffstats
path: root/pkg/gui/cherry_picking.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-29 18:36:54 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-29 20:48:49 +1000
commit630e4469898cb630c93cd309156c7c90bf2acd75 (patch)
tree553d9ac059b8d75190821db9c053d8c12f4f02e6 /pkg/gui/cherry_picking.go
parent44248d9ab0818dfca6a5c1f5ee2ad5b0d45d4998 (diff)
move commits model into models package
Diffstat (limited to 'pkg/gui/cherry_picking.go')
-rw-r--r--pkg/gui/cherry_picking.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/pkg/gui/cherry_picking.go b/pkg/gui/cherry_picking.go
index 99da59f98..1355c7d4e 100644
--- a/pkg/gui/cherry_picking.go
+++ b/pkg/gui/cherry_picking.go
@@ -1,8 +1,6 @@
package gui
-import (
- "github.com/jesseduffield/lazygit/pkg/commands"
-)
+import "github.com/jesseduffield/lazygit/pkg/models"
// you can only copy from one context at a time, because the order and position of commits matter
@@ -12,7 +10,7 @@ func (gui *Gui) resetCherryPickingIfNecessary(context Context) error {
if oldContextKey != context.GetKey() {
// need to reset the cherry picking mode
gui.State.Modes.CherryPicking.ContextKey = context.GetKey()
- gui.State.Modes.CherryPicking.CherryPickedCommits = make([]*commands.Commit, 0)
+ gui.State.Modes.CherryPicking.CherryPickedCommits = make([]*models.Commit, 0)
return gui.rerenderContextViewIfPresent(oldContextKey)
}
@@ -39,7 +37,7 @@ func (gui *Gui) handleCopyCommit() error {
if !ok {
return nil
}
- commit, ok := item.(*commands.Commit)
+ commit, ok := item.(*models.Commit)
if !ok {
return nil
}
@@ -64,7 +62,7 @@ func (gui *Gui) cherryPickedCommitShaMap() map[string]bool {
return commitShaMap
}
-func (gui *Gui) commitsListForContext() []*commands.Commit {
+func (gui *Gui) commitsListForContext() []*models.Commit {
context := gui.currentSideContext()
if context == nil {
return nil
@@ -89,11 +87,11 @@ func (gui *Gui) addCommitToCherryPickedCommits(index int) {
commitsList := gui.commitsListForContext()
commitShaMap[commitsList[index].Sha] = true
- newCommits := []*commands.Commit{}
+ newCommits := []*models.Commit{}
for _, commit := range commitsList {
if commitShaMap[commit.Sha] {
// duplicating just the things we need to put in the rebase TODO list
- newCommits = append(newCommits, &commands.Commit{Name: commit.Name, Sha: commit.Sha})
+ newCommits = append(newCommits, &models.Commit{Name: commit.Name, Sha: commit.Sha})
}
}