Skip to content

Commit 05b3ae9

Browse files
committed
Reference original commits in CherryPicking mode instead of synthesizing new ones
Previously we would create new Commit objects to store in the CherryPicking mode which only contained a name and hash, all other fields were unset. I'm not sure why we did this; it's easier to just reference the original commits. Later on this branch we will need this because we need to determine whether a copied commit was a merge commit (by looking at its Parents field).
1 parent b7d01d6 commit 05b3ae9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pkg/gui/modes/cherrypicking/cherry_picking.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ func (self *CherryPicking) Remove(selectedCommit *models.Commit, commitsList []*
5959
}
6060

6161
func (self *CherryPicking) update(selectedHashSet *set.Set[string], commitsList []*models.Commit) {
62-
cherryPickedCommits := lo.Filter(commitsList, func(commit *models.Commit, _ int) bool {
62+
self.CherryPickedCommits = lo.Filter(commitsList, func(commit *models.Commit, _ int) bool {
6363
return selectedHashSet.Includes(commit.Hash)
6464
})
65-
66-
self.CherryPickedCommits = lo.Map(cherryPickedCommits, func(commit *models.Commit, _ int) *models.Commit {
67-
return &models.Commit{Name: commit.Name, Hash: commit.Hash}
68-
})
6965
}

0 commit comments

Comments
 (0)