mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-08 22:36:49 +02:00
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).
This commit is contained in:
@ -59,11 +59,7 @@ func (self *CherryPicking) Remove(selectedCommit *models.Commit, commitsList []*
|
||||
}
|
||||
|
||||
func (self *CherryPicking) update(selectedHashSet *set.Set[string], commitsList []*models.Commit) {
|
||||
cherryPickedCommits := lo.Filter(commitsList, func(commit *models.Commit, _ int) bool {
|
||||
self.CherryPickedCommits = lo.Filter(commitsList, func(commit *models.Commit, _ int) bool {
|
||||
return selectedHashSet.Includes(commit.Hash)
|
||||
})
|
||||
|
||||
self.CherryPickedCommits = lo.Map(cherryPickedCommits, func(commit *models.Commit, _ int) *models.Commit {
|
||||
return &models.Commit{Name: commit.Name, Hash: commit.Hash}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user