Skip to content

Commit ff49f44

Browse files
committed
Cherry-picked from #2747
1 parent 2078f63 commit ff49f44

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pkg/commands/git_commands/commit_loader.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,24 @@ func (self *CommitLoader) getHydratedRebasingCommits(rebaseMode enums.RebaseMode
222222
return nil, err
223223
}
224224

225+
findFullCommit := lo.Ternary(self.version.IsOlderThan(2, 25, 2),
226+
func(sha string) *models.Commit {
227+
for s, c := range fullCommits {
228+
if strings.HasPrefix(sha, s) {
229+
return c
230+
}
231+
}
232+
return nil
233+
},
234+
func(sha string) *models.Commit {
235+
return fullCommits[sha]
236+
})
237+
225238
hydratedCommits := make([]*models.Commit, 0, len(commits))
226239
for _, rebasingCommit := range commits {
227240
if rebasingCommit.Sha == "" {
228241
hydratedCommits = append(hydratedCommits, rebasingCommit)
229-
} else if commit := fullCommits[rebasingCommit.Sha]; commit != nil {
242+
} else if commit := findFullCommit(rebasingCommit.Sha); commit != nil {
230243
commit.Action = rebasingCommit.Action
231244
commit.Status = rebasingCommit.Status
232245
hydratedCommits = append(hydratedCommits, commit)

0 commit comments

Comments
 (0)