diff --git a/extensions/git/package.json b/extensions/git/package.json index 7a9893c47e0..748868778dd 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -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%", diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 6b150430b8f..0e8ea1c649e 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -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.", diff --git a/extensions/git/src/main.ts b/extensions/git/src/main.ts index cabcce04413..8bf85a1b3ee 100644 --- a/extensions/git/src/main.ts +++ b/extensions/git/src/main.ts @@ -208,14 +208,25 @@ async function checkGitWindows(info: IGit): Promise { return; } + const config = workspace.getConfiguration('git'); + const shouldIgnore = config.get('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); } }