diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-07-29 20:36:16 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-07-31 08:28:03 +0200 |
commit | 18903a7dde07a57a023649bf1eb87d3ce77b6347 (patch) | |
tree | adae001c6decd74c5c03be2eea1b9b62467f6447 /pkg/commands | |
parent | 7cfbfb7183934dd9c2106dc7b521a7e1d6419741 (diff) |
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).
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/git_commands/commit_loader.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/commands/git_commands/commit_loader.go b/pkg/commands/git_commands/commit_loader.go index f138adfaf..22b92ea0a 100644 --- a/pkg/commands/git_commands/commit_loader.go +++ b/pkg/commands/git_commands/commit_loader.go @@ -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) { |