Procházet zdrojové kódy

Removes repo casing warning

Should hopefully no longer be required
main
Eric Amodio před 2 roky
rodič
revize
8b9bd7945e
4 změnil soubory, kde provedl 1 přidání a 47 odebrání
  1. +0
    -6
      package.json
  2. +0
    -1
      src/config.ts
  3. +1
    -31
      src/env/node/git/localGitProvider.ts
  4. +0
    -9
      src/messages.ts

+ 0
- 6
package.json Zobrazit soubor

@ -2815,7 +2815,6 @@
"suppressGitDisabledWarning": false,
"suppressGitMissingWarning": false,
"suppressGitVersionWarning": false,
"suppressImproperWorkspaceCasingWarning": false,
"suppressLineUncommittedWarning": false,
"suppressNoRepositoryWarning": false,
"suppressRebaseSwitchToTextWarning": false
@ -2861,11 +2860,6 @@
"default": false,
"description": "Git Version Warning"
},
"suppressImproperWorkspaceCasingWarning": {
"type": "boolean",
"default": false,
"description": "Improper Workspace Casing Warning"
},
"suppressLineUncommittedWarning": {
"type": "boolean",
"default": false,

+ 0
- 1
src/config.ts Zobrazit soubor

@ -340,7 +340,6 @@ export interface AdvancedConfig {
suppressGitDisabledWarning: boolean;
suppressGitMissingWarning: boolean;
suppressGitVersionWarning: boolean;
suppressImproperWorkspaceCasingWarning: boolean;
suppressLineUncommittedWarning: boolean;
suppressNoRepositoryWarning: boolean;
suppressRebaseSwitchToTextWarning: boolean;

+ 1
- 31
src/env/node/git/localGitProvider.ts Zobrazit soubor

@ -720,37 +720,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
return repoPath ? Uri.file(repoPath) : undefined;
} catch (ex) {
Logger.error(ex, cc);
repoPath = undefined;
return repoPath;
} finally {
if (repoPath) {
void this.ensureProperWorkspaceCasing(repoPath, uri);
}
}
}
@gate(() => '')
private async ensureProperWorkspaceCasing(repoPath: string, uri: Uri) {
if (this.container.config.advanced.messages.suppressImproperWorkspaceCasingWarning) return;
const path = uri.fsPath.replace(/\\/g, '/');
let regexPath;
let testPath;
if (path > repoPath) {
regexPath = path;
testPath = repoPath;
} else {
testPath = path;
regexPath = repoPath;
}
let pathRegex = new RegExp(`^${regexPath}`);
if (!pathRegex.test(testPath)) {
pathRegex = new RegExp(pathRegex, 'i');
if (pathRegex.test(testPath)) {
await Messages.showIncorrectWorkspaceCasingWarningMessage();
}
return undefined;
}
}

+ 0
- 9
src/messages.ts Zobrazit soubor

@ -13,7 +13,6 @@ export const enum SuppressedMessages {
GitDisabledWarning = 'suppressGitDisabledWarning',
GitMissingWarning = 'suppressGitMissingWarning',
GitVersionWarning = 'suppressGitVersionWarning',
IncorrectWorkspaceCasingWarning = 'suppressImproperWorkspaceCasingWarning',
LineUncommittedWarning = 'suppressLineUncommittedWarning',
NoRepositoryWarning = 'suppressNoRepositoryWarning',
RebaseSwitchToTextWarning = 'suppressRebaseSwitchToTextWarning',
@ -123,14 +122,6 @@ export class Messages {
);
}
static async showIncorrectWorkspaceCasingWarningMessage(): Promise<void> {
void (await Messages.showMessage(
'warn',
'This workspace was opened with a different casing than what exists on disk. Please re-open this workspace with the exact casing as it exists on disk, otherwise you may experience issues with certain Git features, such as missing blame or history.',
SuppressedMessages.IncorrectWorkspaceCasingWarning,
));
}
static showInsidersErrorMessage() {
return Messages.showMessage(
'error',

Načítá se…
Zrušit
Uložit