diff options
author | skanehira <sho19921005@gmail.com> | 2019-03-28 18:58:34 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-04-06 13:02:20 +1100 |
commit | f34be1896af14df2d636aa9aa3cfa857994a22b5 (patch) | |
tree | 5ab2fdbb29f2b95b074aa2075f5e3bab8fd66b8c /pkg/git/commit_list_builder.go | |
parent | c350cdba4337fa8961e5fbe16e70d73fae7ccc20 (diff) |
fixed some #397
Diffstat (limited to 'pkg/git/commit_list_builder.go')
-rw-r--r-- | pkg/git/commit_list_builder.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pkg/git/commit_list_builder.go b/pkg/git/commit_list_builder.go index 4f3268195..32116656d 100644 --- a/pkg/git/commit_list_builder.go +++ b/pkg/git/commit_list_builder.go @@ -31,16 +31,18 @@ type CommitListBuilder struct { OSCommand *commands.OSCommand Tr *i18n.Localizer CherryPickedCommits []*commands.Commit + DiffEntries []*commands.Commit } // NewCommitListBuilder builds a new commit list builder -func NewCommitListBuilder(log *logrus.Entry, gitCommand *commands.GitCommand, osCommand *commands.OSCommand, tr *i18n.Localizer, cherryPickedCommits []*commands.Commit) (*CommitListBuilder, error) { +func NewCommitListBuilder(log *logrus.Entry, gitCommand *commands.GitCommand, osCommand *commands.OSCommand, tr *i18n.Localizer, cherryPickedCommits []*commands.Commit, diffEntries []*commands.Commit) (*CommitListBuilder, error) { return &CommitListBuilder{ Log: log, GitCommand: gitCommand, OSCommand: osCommand, Tr: tr, CherryPickedCommits: cherryPickedCommits, + DiffEntries: diffEntries, }, nil } @@ -96,6 +98,14 @@ func (c *CommitListBuilder) GetCommits() ([]*commands.Commit, error) { return nil, err } + for _, commit := range commits { + for _, entry := range c.DiffEntries { + if entry.Sha == commit.Sha { + commit.Status = "selected" + } + } + } + return commits, nil } |