summaryrefslogtreecommitdiffstats
path: root/pkg/commands/loaders/commits.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-03-19 19:51:48 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-24 20:14:41 +1100
commit94a53484a183bb32b066dc51fb90948dead634a1 (patch)
tree51e76a607b68a309c3e7573432392b125a3e2783 /pkg/commands/loaders/commits.go
parent1b75ed37403ac2997cb6a5ede92d87f1a1eb96b1 (diff)
would you believe that I'm adding even more generics
Diffstat (limited to 'pkg/commands/loaders/commits.go')
-rw-r--r--pkg/commands/loaders/commits.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/commands/loaders/commits.go b/pkg/commands/loaders/commits.go
index 20721be42..c370cc059 100644
--- a/pkg/commands/loaders/commits.go
+++ b/pkg/commands/loaders/commits.go
@@ -307,6 +307,7 @@ func (self *CommitLoader) getInteractiveRebasingCommits() ([]*models.Commit, err
commits := []*models.Commit{}
lines := strings.Split(string(bytesContent), "\n")
+
for _, line := range lines {
if line == "" || line == "noop" {
return commits, nil
@@ -315,12 +316,12 @@ func (self *CommitLoader) getInteractiveRebasingCommits() ([]*models.Commit, err
continue
}
splitLine := strings.Split(line, " ")
- commits = append([]*models.Commit{{
+ commits = slices.Prepend(commits, &models.Commit{
Sha: splitLine[1],
Name: strings.Join(splitLine[2:], " "),
Status: "rebasing",
Action: splitLine[0],
- }}, commits...)
+ })
}
return commits, nil