mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 04:45:47 +02:00
Fix interactive rebase with git 2.25.1 and earlier (#2747)
This commit is contained in:
commit
f9414f275d
1 changed files with 14 additions and 1 deletions
|
@ -222,11 +222,24 @@ func (self *CommitLoader) getHydratedRebasingCommits(rebaseMode enums.RebaseMode
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
findFullCommit := lo.Ternary(self.version.IsOlderThan(2, 25, 2),
|
||||||
|
func(sha string) *models.Commit {
|
||||||
|
for s, c := range fullCommits {
|
||||||
|
if strings.HasPrefix(s, sha) {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
func(sha string) *models.Commit {
|
||||||
|
return fullCommits[sha]
|
||||||
|
})
|
||||||
|
|
||||||
hydratedCommits := make([]*models.Commit, 0, len(commits))
|
hydratedCommits := make([]*models.Commit, 0, len(commits))
|
||||||
for _, rebasingCommit := range commits {
|
for _, rebasingCommit := range commits {
|
||||||
if rebasingCommit.Sha == "" {
|
if rebasingCommit.Sha == "" {
|
||||||
hydratedCommits = append(hydratedCommits, rebasingCommit)
|
hydratedCommits = append(hydratedCommits, rebasingCommit)
|
||||||
} else if commit := fullCommits[rebasingCommit.Sha]; commit != nil {
|
} else if commit := findFullCommit(rebasingCommit.Sha); commit != nil {
|
||||||
commit.Action = rebasingCommit.Action
|
commit.Action = rebasingCommit.Action
|
||||||
commit.Status = rebasingCommit.Status
|
commit.Status = rebasingCommit.Status
|
||||||
hydratedCommits = append(hydratedCommits, commit)
|
hydratedCommits = append(hydratedCommits, commit)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue