diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2022-03-26 22:03:32 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-04-02 17:04:42 +1100 |
commit | 30be50b641dbe594d7968e79536028f22beee1b0 (patch) | |
tree | 3366984909742fd0cd1997f4a923910df266cd42 /pkg/commands/loaders/commits.go | |
parent | 99ecc1cfdff9a29a8cfa1bf21cb80c082bee212b (diff) |
add `Commit.ParentRefName()`
Diffstat (limited to 'pkg/commands/loaders/commits.go')
-rw-r--r-- | pkg/commands/loaders/commits.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/commands/loaders/commits.go b/pkg/commands/loaders/commits.go index ae4455df5..fd6ce64a8 100644 --- a/pkg/commands/loaders/commits.go +++ b/pkg/commands/loaders/commits.go @@ -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, } } |