mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 1b314ab317fbff7d799b21754326b7d849889ceb
This commit is contained in:
@@ -128,7 +128,7 @@ async function warnAboutMissingGit(): Promise<void> {
|
||||
}
|
||||
}*/
|
||||
|
||||
export async function _activate(context: ExtensionContext): Promise<GitExtension> {
|
||||
export async function _activate(context: ExtensionContext): Promise<GitExtensionImpl> {
|
||||
const disposables: Disposable[] = [];
|
||||
context.subscriptions.push(new Disposable(() => Disposable.from(...disposables).dispose()));
|
||||
|
||||
@@ -176,8 +176,7 @@ export async function activate(context: ExtensionContext): Promise<GitExtension>
|
||||
return result;
|
||||
}
|
||||
|
||||
// @ts-expect-error
|
||||
async function checkGitVersion(info: IGit): Promise<void> {
|
||||
async function checkGitv1(info: IGit): Promise<void> {
|
||||
const config = workspace.getConfiguration('git');
|
||||
const shouldIgnore = config.get<boolean>('ignoreLegacyWarning') === true;
|
||||
|
||||
@@ -204,3 +203,28 @@ async function checkGitVersion(info: IGit): Promise<void> {
|
||||
await config.update('ignoreLegacyWarning', true, true);
|
||||
}
|
||||
}
|
||||
|
||||
async function checkGitWindows(info: IGit): Promise<void> {
|
||||
if (!/^2\.(25|26)\./.test(info.version)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const update = localize('updateGit', "Update Git");
|
||||
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
|
||||
);
|
||||
|
||||
if (choice === update) {
|
||||
commands.executeCommand('vscode.open', Uri.parse('https://git-scm.com/'));
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-expect-error
|
||||
async function checkGitVersion(info: IGit): Promise<void> {
|
||||
await checkGitv1(info);
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
await checkGitWindows(info);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user