Fixes #91377 - save previous ref

This commit is contained in:
Eric Amodio 2020-03-23 17:15:41 -04:00
parent a5987ce853
commit 9c1e26890c

View file

@ -146,12 +146,12 @@ export class GitTimelineProvider implements TimelineProvider {
}
let dateFormatter: dayjs.Dayjs;
const items = commits.map<GitTimelineItem>(c => {
const items = commits.map<GitTimelineItem>((c, i) => {
const date = c.commitDate; // c.authorDate
dateFormatter = dayjs(date);
const item = new GitTimelineItem(c.hash, `${c.hash}^`, c.message, date?.getTime() ?? 0, c.hash, 'git:file:commit');
const item = new GitTimelineItem(c.hash, commits[i + 1]?.hash ?? `${c.hash}^`, c.message, date?.getTime() ?? 0, c.hash, 'git:file:commit');
item.iconPath = new (ThemeIcon as any)('git-commit');
item.description = c.authorName;
item.detail = `${c.authorName} (${c.authorEmail}) \u2014 ${c.hash.substr(0, 8)}\n${dateFormatter.format('MMMM Do, YYYY h:mma')}\n\n${c.message}`;