Parcourir la source

Fixes #860 & #862 - switch to iso dates

Older version of Git don't support unix timestamp dates
main
Eric Amodio il y a 5 ans
Parent
révision
705a13ca44
4 fichiers modifiés avec 7 ajouts et 5 suppressions
  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 Voir le fichier

@ -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 Voir le fichier

@ -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 Voir le fichier

@ -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 Voir le fichier

@ -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

Chargement…
Annuler
Enregistrer