Skip to content

Commit 687bae4

Browse files
committed
Simplify the MergeRebasingCommits call in GetCommits (slightly)
MergeRebasingCommits already merges the rebasing commits into the commits slice that is passed in, so it doesn't make sense to append the result to commits again. It isn't a problem, but only because commits is always empty.
1 parent ff465e2 commit 687bae4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/commands/git_commands/commit_loader.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,13 @@ type GetCommitsOptions struct {
7171
// GetCommits obtains the commits of the current branch
7272
func (self *CommitLoader) GetCommits(opts GetCommitsOptions) ([]*models.Commit, error) {
7373
commits := []*models.Commit{}
74-
var rebasingCommits []*models.Commit
7574

7675
if opts.IncludeRebaseCommits && opts.FilterPath == "" {
7776
var err error
78-
rebasingCommits, err = self.MergeRebasingCommits(commits)
77+
commits, err = self.MergeRebasingCommits(commits)
7978
if err != nil {
8079
return nil, err
8180
}
82-
commits = append(commits, rebasingCommits...)
8381
}
8482

8583
wg := sync.WaitGroup{}

0 commit comments

Comments
 (0)