mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-10 20:05:50 +02:00
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.
This commit is contained in:
parent
ff465e2581
commit
687bae48ed
1 changed files with 1 additions and 3 deletions
|
@ -71,15 +71,13 @@ type GetCommitsOptions struct {
|
|||
// GetCommits obtains the commits of the current branch
|
||||
func (self *CommitLoader) GetCommits(opts GetCommitsOptions) ([]*models.Commit, error) {
|
||||
commits := []*models.Commit{}
|
||||
var rebasingCommits []*models.Commit
|
||||
|
||||
if opts.IncludeRebaseCommits && opts.FilterPath == "" {
|
||||
var err error
|
||||
rebasingCommits, err = self.MergeRebasingCommits(commits)
|
||||
commits, err = self.MergeRebasingCommits(commits)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
commits = append(commits, rebasingCommits...)
|
||||
}
|
||||
|
||||
wg := sync.WaitGroup{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue