1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-29 00:51:35 +02:00

add Commit.ParentRefName()

This commit is contained in:
Ryooooooga
2022-03-26 22:03:32 +09:00
committed by Jesse Duffield
parent 99ecc1cfdf
commit 30be50b641
4 changed files with 49 additions and 14 deletions

View File

@ -178,6 +178,11 @@ func (self *CommitLoader) extractCommitFromLine(line string) *models.Commit {
unitTimestampInt, _ := strconv.Atoi(unixTimestamp)
parents := []string{}
if len(parentHashes) > 0 {
parents = strings.Split(parentHashes, " ")
}
return &models.Commit{
Sha: sha,
Name: message,
@ -185,7 +190,7 @@ func (self *CommitLoader) extractCommitFromLine(line string) *models.Commit {
ExtraInfo: extraInfo,
UnixTimestamp: int64(unitTimestampInt),
Author: author,
Parents: strings.Split(parentHashes, " "),
Parents: parents,
}
}