1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-27 23:08:02 +02:00

Make setCommitMergedStatuses a non-member function

It doesn't depend on anything in CommitLoader, so it can be free-standing, and
that makes it easier to test (see next commit).
This commit is contained in:
Stefan Haller 2023-07-29 20:36:16 +02:00
parent 7cfbfb7183
commit 18903a7dde

View File

@ -135,7 +135,7 @@ func (self *CommitLoader) GetCommits(opts GetCommitsOptions) ([]*models.Commit,
}
if ancestor != "" {
commits = self.setCommitMergedStatuses(ancestor, commits)
commits = setCommitMergedStatuses(ancestor, commits)
}
return commits, nil
@ -492,7 +492,7 @@ func (self *CommitLoader) commitFromPatch(content string) *models.Commit {
}
}
func (self *CommitLoader) setCommitMergedStatuses(ancestor string, commits []*models.Commit) []*models.Commit {
func setCommitMergedStatuses(ancestor string, commits []*models.Commit) []*models.Commit {
passedAncestor := false
for i, commit := range commits {
if strings.HasPrefix(ancestor, commit.Sha) {