Fixes #55 - adds fallback for previous git versions

Reverts git version requirement to >= 2.2.0
This commit is contained in:
Eric Amodio
2017-03-27 10:56:58 -04:00
parent 758d331e69
commit 46ff70e969
5 changed files with 64 additions and 17 deletions

View File

@@ -146,10 +146,9 @@ async function notifyOnNewGitLensVersion(context: ExtensionContext, version: str
async function notifyOnUnsupportedGitVersion(context: ExtensionContext, version: string) {
if (context.globalState.get(WorkspaceState.SuppressGitVersionWarning, false)) return;
const [major, minor] = version.split('.');
// If git is less than v2.11.0
if (parseInt(major, 10) < 2 || parseInt(minor, 10) < 11) {
const result = await window.showErrorMessage(`GitLens requires a newer version of Git (>= 2.11.0) than is currently installed (${version}). Please install a more recent version of Git.`, `Don't Show Again`);
// If git is less than v2.2.0
if (!Git.validateVersion(2, 2)) {
const result = await window.showErrorMessage(`GitLens requires a newer version of Git (>= 2.2.0) than is currently installed (${version}). Please install a more recent version of Git.`, `Don't Show Again`);
if (result === `Don't Show Again`) {
context.globalState.update(WorkspaceState.SuppressGitVersionWarning, true);
}