Skip to content

Commit 705a13c

Browse files
committed
Fixes #860 & #862 - switch to iso dates
Older version of Git don't support unix timestamp dates
1 parent 3dc9e69 commit 705a13c

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1717

1818
### Fixed
1919

20+
- Fixes [#862](https://github.com/eamodio/vscode-gitlens/issues/862) - Command failed when expanding a local branch
21+
- Fixes [#860](https://github.com/eamodio/vscode-gitlens/issues/860) - Unknown date format error
2022
- Fixes [#858](https://github.com/eamodio/vscode-gitlens/issues/858) - GitHub avatars in blame line hovers are huge
2123
- Fixes issue with locating a working file when the file is staged or modified
2224

src/git/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ export class Git {
870870
repoPath: string,
871871
{ all, branch, since }: { all?: boolean; branch?: string; since?: string } = {}
872872
): Promise<string> {
873-
const params = ['log', '-g', `--format=${GitReflogParser.defaultFormat}`, '--date=unix'];
873+
const params = ['log', '-g', `--format=${GitReflogParser.defaultFormat}`, '--date=iso8601'];
874874
if (all) {
875875
params.push('--all');
876876
}

src/git/parsers/branchParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class GitBranchParser {
1515
`${lb}u${rb}%(upstream:short)`, // branch upstream
1616
`${lb}t${rb}%(upstream:track)`, // branch upstream tracking state
1717
`${lb}r${rb}%(objectname)`, // ref
18-
`${lb}d${rb}%(committerdate:unix)` // committer date
18+
`${lb}d${rb}%(committerdate:iso8601)` // committer date
1919
].join('');
2020

2121
@debug({ args: false, singleLine: true })
@@ -57,7 +57,7 @@ export class GitBranchParser {
5757
name,
5858
remote,
5959
current.charCodeAt(0) === 42, // '*',
60-
new Date(Number(date) * 1000),
60+
new Date(date),
6161
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869
6262
ref == null || ref.length === 0 ? undefined : ` ${ref}`.substr(1),
6363
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869

src/git/parsers/reflogParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const rb = '%x3e'; // `%x${'>'.charCodeAt(0).toString(16)}`;
1313
export class GitReflogParser {
1414
static defaultFormat = [
1515
`${lb}r${rb}%H`, // ref
16-
`${lb}d${rb}%gD`, // reflog selector (with UNIX timestamp)
16+
`${lb}d${rb}%gD`, // reflog selector (with iso8601 timestamp)
1717
`${lb}s${rb}%gs` // reflog subject
1818
// `${lb}n${rb}%D` // ref names
1919
].join('');
@@ -95,7 +95,7 @@ export class GitReflogParser {
9595
` ${sha}`.substr(1),
9696
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869
9797
` ${selector}`.substr(1),
98-
new Date(Number(date) * 1000),
98+
new Date(date),
9999
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869
100100
` ${command}`.substr(1),
101101
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869

0 commit comments

Comments
 (0)