From a543a474e74a94dd39a83101f42a34ae9fe9acbc Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Thu, 6 Dec 2018 01:37:49 -0500 Subject: [PATCH] Fixes #576 - fails to load with older versions of git --- CHANGELOG.md | 1 + src/git/git.ts | 3 ++- src/git/gitService.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b71458a..da2259f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Fixed +- Fixes [#576](https://github.com/eamodio/vscode-gitlens/issues/576) — Fails to load with older versions of git - Fixes an issue where the _Copy Commit Message to Clipboard_ command fails (and probably others too) — a regression caused by the attempted fix for [#568](https://github.com/eamodio/vscode-gitlens/issues/565) ## [9.0.2] - 2018-12-05 diff --git a/src/git/git.ts b/src/git/git.ts index dc58289..f3c442e 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -69,7 +69,8 @@ const GitWarnings = { mustRunInWorkTree: /this operation must be run in a work tree/i, patchWithConflicts: /Applied patch to \'.*?\' with conflicts/i, noRemoteRepositorySpecified: /No remote repository specified\./i, - remoteConnectionError: /Could not read from remote repository/i + remoteConnectionError: /Could not read from remote repository/i, + notAGitCommand: /\'.+\' is not a git command/i }; export enum GitErrorHandling { diff --git a/src/git/gitService.ts b/src/git/gitService.ts index ed66159..4576470 100644 --- a/src/git/gitService.ts +++ b/src/git/gitService.ts @@ -1132,7 +1132,7 @@ export class GitService implements Disposable { const author = `${user.name} <${user.email}>`; // Check if there is a mailmap for the current user const mappedAuthor = await Git.check_mailmap(repoPath, author); - if (author !== mappedAuthor) { + if (mappedAuthor != null && mappedAuthor.length !== 0 && author !== mappedAuthor) { match = mappedAuthorRegex.exec(mappedAuthor); if (match != null) { [, user.name, user.email] = match;