Browse Source

Fixes #1294 - removes (if) syntax

main
Eric Amodio 4 years ago
parent
commit
10ec613441
2 changed files with 13 additions and 5 deletions
  1. +6
    -0
      CHANGELOG.md
  2. +7
    -5
      src/git/parsers/tagParser.ts

+ 6
- 0
CHANGELOG.md View File

@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Fixed
- Fixes [#1294](https://github.com/eamodio/vscode-gitlens/issues/1294) - Error when open commits list
## [11.1.0] - 2020-12-23
### Added

+ 7
- 5
src/git/parsers/tagParser.ts View File

@ -2,7 +2,7 @@
import { GitTag } from '../git';
import { debug } from '../../system';
const tagRegex = /^<n>(.+)<r>(.*)<d>(.*)<ad>(.*)<s>(.*)$/gm;
const tagRegex = /^<n>(.+)<\*r>(.*)<r>(.*)<d>(.*)<ad>(.*)<s>(.*)$/gm;
// Using %x00 codes because some shells seem to try to expand things if not
const lb = '%3c'; // `%${'<'.charCodeAt(0).toString(16)}`;
@ -11,7 +11,8 @@ const rb = '%3e'; // `%${'>'.charCodeAt(0).toString(16)}`;
export class GitTagParser {
static defaultFormat = [
`${lb}n${rb}%(refname)`, // tag name
`${lb}r${rb}%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end)`, // ref
`${lb}*r${rb}%(*objectname)`, // ref
`${lb}r${rb}%(objectname)`, // ref
`${lb}d${rb}%(creatordate:iso8601)`, // created date
`${lb}ad${rb}%(authordate:iso8601)`, // author date
`${lb}s${rb}%(subject)`, // message
@ -24,7 +25,8 @@ export class GitTagParser {
const tags: GitTag[] = [];
let name;
let ref;
let ref1;
let ref2;
let date;
let commitDate;
let message;
@ -34,7 +36,7 @@ export class GitTagParser {
match = tagRegex.exec(data);
if (match == null) break;
[, name, ref, date, commitDate, message] = match;
[, name, ref1, ref2, date, commitDate, message] = match;
// Strip off refs/tags/
name = name.substr(10);
@ -44,7 +46,7 @@ export class GitTagParser {
repoPath,
name,
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869
` ${ref}`.substr(1),
` ${ref1 || ref2}`.substr(1),
// Stops excessive memory usage -- https://bugs.chromium.org/p/v8/issues/detail?id=2869
` ${message}`.substr(1),
new Date(date),

||||||
x
 
000:0
Loading…
Cancel
Save