浏览代码

Fixes #860 & #862 - switch to iso dates

Older version of Git don't support unix timestamp dates
main
Eric Amodio 5 年前
父节点
当前提交
705a13ca44
共有 4 个文件被更改,包括 7 次插入5 次删除
  1. +2
    -0
      CHANGELOG.md
  2. +1
    -1
      src/git/git.ts
  3. +2
    -2
      src/git/parsers/branchParser.ts
  4. +2
    -2
      src/git/parsers/reflogParser.ts

+ 2
- 0
CHANGELOG.md 查看文件

@ -17,6 +17,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#862](https://github.com/eamodio/vscode-gitlens/issues/862) - Command failed when expanding a local branch
- Fixes [#860](https://github.com/eamodio/vscode-gitlens/issues/860) - Unknown date format error
- Fixes [#858](https://github.com/eamodio/vscode-gitlens/issues/858) - GitHub avatars in blame line hovers are huge
- Fixes issue with locating a working file when the file is staged or modified

+ 1
- 1
src/git/git.ts 查看文件

@ -870,7 +870,7 @@ export class Git {
repoPath: string,
{ all, branch, since }: { all?: boolean; branch?: string; since?: string } = {}
): Promise<string> {
const params = ['log', '-g', `--format=${GitReflogParser.defaultFormat}`, '--date=unix'];
const params = ['log', '-g', `--format=${GitReflogParser.defaultFormat}`, '--date=iso8601'];
if (all) {
params.push('--all');
}

+ 2
- 2
src/git/parsers/branchParser.ts 查看文件

@ -15,7 +15,7 @@ export class GitBranchParser {
`${lb}u${rb}%(upstream:short)`, // branch upstream
`${lb}t${rb}%(upstream:track)`, // branch upstream tracking state
`${lb}r${rb}%(objectname)`, // ref
`${lb}d${rb}%(committerdate:unix)` // committer date
`${lb}d${rb}%(committerdate:iso8601)` // committer date
].join('');
@debug({ args: false, singleLine: true })
@ -57,7 +57,7 @@ export class GitBranchParser {
name,
remote,
current.charCodeAt(0) === 42, // '*',
new Date(Number(date) * 1000),
new Date(date),
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869
ref == null || ref.length === 0 ? undefined : ` ${ref}`.substr(1),
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869

+ 2
- 2
src/git/parsers/reflogParser.ts 查看文件

@ -13,7 +13,7 @@ const rb = '%x3e'; // `%x${'>'.charCodeAt(0).toString(16)}`;
export class GitReflogParser {
static defaultFormat = [
`${lb}r${rb}%H`, // ref
`${lb}d${rb}%gD`, // reflog selector (with UNIX timestamp)
`${lb}d${rb}%gD`, // reflog selector (with iso8601 timestamp)
`${lb}s${rb}%gs` // reflog subject
// `${lb}n${rb}%D` // ref names
].join('');
@ -95,7 +95,7 @@ export class GitReflogParser {
` ${sha}`.substr(1),
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869
` ${selector}`.substr(1),
new Date(Number(date) * 1000),
new Date(date),
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869
` ${command}`.substr(1),
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869

正在加载...
取消
保存