diff options
Diffstat (limited to 'pkg/commands/loaders/reflog_commits.go')
-rw-r--r-- | pkg/commands/loaders/reflog_commits.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pkg/commands/loaders/reflog_commits.go b/pkg/commands/loaders/reflog_commits.go index 56c1c71f9..56d10b9f3 100644 --- a/pkg/commands/loaders/reflog_commits.go +++ b/pkg/commands/loaders/reflog_commits.go @@ -32,21 +32,28 @@ func (self *ReflogCommitLoader) GetReflogCommits(lastReflogCommit *models.Commit filterPathArg = fmt.Sprintf(" --follow -- %s", self.cmd.Quote(filterPath)) } - cmdObj := self.cmd.New(fmt.Sprintf(`git log -g --abbrev=40 --format="%s"%s`, "%h%x00%ct%x00%gs", filterPathArg)).DontLog() + cmdObj := self.cmd.New(fmt.Sprintf(`git log -g --abbrev=40 --format="%s"%s`, "%h%x00%ct%x00%gs%x00%p", filterPathArg)).DontLog() onlyObtainedNewReflogCommits := false err := cmdObj.RunAndProcessLines(func(line string) (bool, error) { - fields := strings.SplitN(line, "\x00", 3) - if len(fields) <= 2 { + fields := strings.SplitN(line, "\x00", 4) + if len(fields) <= 3 { return false, nil } unixTimestamp, _ := strconv.Atoi(fields[1]) + parentHashes := fields[3] + parents := []string{} + if len(parentHashes) > 0 { + parents = strings.Split(parentHashes, " ") + } + commit := &models.Commit{ Sha: fields[0], Name: fields[2], UnixTimestamp: int64(unixTimestamp), Status: "reflog", + Parents: parents, } // note that the unix timestamp here is the timestamp of the COMMIT, not the reflog entry itself, |