diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index 06055ef..06dfeec 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -3095,7 +3095,7 @@ export class LocalGitProvider implements GitProvider, Disposable { return cachedLog.item; } - if (options.ref != null || options.limit != null) { + if (options.ref != null || (options.limit != null && options.limit !== 0)) { // Since we are looking for partial log, see if we have the log of the whole file const cachedLog = doc.state.getLog( `log${options.renames ? ':follow' : ''}${options.reverse ? ':reverse' : ''}`, diff --git a/src/plus/webviews/timeline/timelineWebview.ts b/src/plus/webviews/timeline/timelineWebview.ts index 3968c0c..f864112 100644 --- a/src/plus/webviews/timeline/timelineWebview.ts +++ b/src/plus/webviews/timeline/timelineWebview.ts @@ -474,14 +474,26 @@ function generateRandomTimelineDataset(): Commit[] { function getPeriodDate(period: Period): Date { const [number, unit] = period.split('|'); + let date; switch (unit) { case 'D': - return createFromDateDelta(new Date(), { days: -parseInt(number, 10) }); + date = createFromDateDelta(new Date(), { days: -parseInt(number, 10) }); + break; case 'M': - return createFromDateDelta(new Date(), { months: -parseInt(number, 10) }); + date = createFromDateDelta(new Date(), { months: -parseInt(number, 10) }); + break; case 'Y': - return createFromDateDelta(new Date(), { years: -parseInt(number, 10) }); + date = createFromDateDelta(new Date(), { years: -parseInt(number, 10) }); + break; default: - return createFromDateDelta(new Date(), { months: -3 }); + date = createFromDateDelta(new Date(), { months: -3 }); + break; } + + // If we are more than 1/2 way through the day, then set the date to the next day + if (date.getHours() >= 12) { + date.setDate(date.getDate() + 1); + } + date.setHours(0, 0, 0, 0); + return date; }