This commit is contained in:
João Moreno 2020-08-05 12:09:13 +02:00
parent b50e599a14
commit 2f2ba0d764
No known key found for this signature in database
GPG key ID: 896B853774D1A575
3 changed files with 18 additions and 1 deletions

View file

@ -1501,6 +1501,11 @@
"description": "%config.ignoreMissingGitWarning%",
"default": false
},
"git.ignoreWindowsGit27Warning": {
"type": "boolean",
"description": "%config.ignoreWindowsGit27Warning%",
"default": false
},
"git.ignoreLimitWarning": {
"type": "boolean",
"description": "%config.ignoreLimitWarning%",

View file

@ -99,6 +99,7 @@
"config.branchWhitespaceChar": "The character to replace whitespace in new branch names.",
"config.ignoreLegacyWarning": "Ignores the legacy Git warning.",
"config.ignoreMissingGitWarning": "Ignores the warning when Git is missing.",
"config.ignoreWindowsGit27Warning": "Ignores the warning when Git 2.25 - 2.26 is installed on Windows.",
"config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository.",
"config.defaultCloneDirectory": "The default location to clone a git repository.",
"config.enableSmartCommit": "Commit all changes when there are no staged changes.",

View file

@ -208,14 +208,25 @@ async function checkGitWindows(info: IGit): Promise<void> {
return;
}
const config = workspace.getConfiguration('git');
const shouldIgnore = config.get<boolean>('ignoreWindowsGit27Warning') === true;
if (shouldIgnore) {
return;
}
const update = localize('updateGit', "Update Git");
const neverShowAgain = localize('neverShowAgain', "Don't Show Again");
const choice = await window.showWarningMessage(
localize('git2526', "There are known issues with the installed Git {0}. Please update to Git >= 2.27 for the git features to work correctly.", info.version),
update
update,
neverShowAgain
);
if (choice === update) {
commands.executeCommand('vscode.open', Uri.parse('https://git-scm.com/'));
} else if (choice === neverShowAgain) {
await config.update('ignoreWindowsGit27Warning', true, true);
}
}