summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/commit_loader.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-07-24 13:06:42 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-07-30 18:51:23 +1000
commite33fe37a99d4b3866970b1b2f40169d1bc9afa2e (patch)
tree0027f612fb72b2603044d04389da0236df28d864 /pkg/commands/git_commands/commit_loader.go
parentea54cb6e9c07ebca4a53e691fcb3cf993c793a50 (diff)
Standardise on using lo for slice functions
We've been sometimes using lo and sometimes using my slices package, and we need to pick one for consistency. Lo is more extensive and better maintained so we're going with that. My slices package was a superset of go's own slices package so in some places I've just used the official one (the methods were just wrappers anyway). I've also moved the remaining methods into the utils package.
Diffstat (limited to 'pkg/commands/git_commands/commit_loader.go')
-rw-r--r--pkg/commands/git_commands/commit_loader.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/commands/git_commands/commit_loader.go b/pkg/commands/git_commands/commit_loader.go
index ac0f19363..f138adfaf 100644
--- a/pkg/commands/git_commands/commit_loader.go
+++ b/pkg/commands/git_commands/commit_loader.go
@@ -11,7 +11,6 @@ import (
"sync"
"github.com/fsmiamoto/git-todo-parser/todo"
- "github.com/jesseduffield/generics/slices"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
"github.com/jesseduffield/lazygit/pkg/commands/types/enums"
@@ -233,7 +232,7 @@ func (self *CommitLoader) getHydratedRebasingCommits(rebaseMode enums.RebaseMode
return nil, nil
}
- commitShas := slices.FilterMap(commits, func(commit *models.Commit) (string, bool) {
+ commitShas := lo.FilterMap(commits, func(commit *models.Commit, _ int) (string, bool) {
return commit.Sha, commit.Sha != ""
})
@@ -379,7 +378,7 @@ func (self *CommitLoader) getInteractiveRebasingCommits() ([]*models.Commit, err
// Command does not have a commit associated, skip
continue
}
- commits = slices.Prepend(commits, &models.Commit{
+ commits = utils.Prepend(commits, &models.Commit{
Sha: t.Commit,
Name: t.Msg,
Status: models.StatusRebasing,