提交 b18b7959 编写于 作者: J Joao Moreno

fixes #53668

上级 0f576d4c
......@@ -881,7 +881,16 @@
"scope": "application"
},
"git.autoRepositoryDetection": {
"type": "boolean",
"type": [
"boolean",
"string"
],
"enum": [
true,
false,
"subFolders",
"openEditors"
],
"description": "%config.autoRepositoryDetection%",
"default": true
},
......@@ -1151,4 +1160,4 @@
"@types/which": "^1.0.28",
"mocha": "^3.2.0"
}
}
}
\ No newline at end of file
......@@ -51,7 +51,7 @@
"command.stashPopLatest": "Pop Latest Stash",
"config.enabled": "Whether git is enabled",
"config.path": "Path to the git executable",
"config.autoRepositoryDetection": "Whether repositories should be automatically detected",
"config.autoRepositoryDetection": "Configures when repositories should be automatically detected.",
"config.autorefresh": "Whether auto refreshing is enabled",
"config.autofetch": "Whether auto fetching is enabled",
"config.enableLongCommitWarning": "Whether long commit messages should be warned about",
......
......@@ -91,6 +91,13 @@ export class Model {
* for git repositories.
*/
private async scanWorkspaceFolders(): Promise<void> {
const config = workspace.getConfiguration('git');
const autoRepositoryDetection = config.get<boolean | 'subFolders' | 'openEditors'>('autoRepositoryDetection');
if (autoRepositoryDetection !== true && autoRepositoryDetection !== 'subFolders') {
return;
}
for (const folder of workspace.workspaceFolders || []) {
const root = folder.uri.fsPath;
......@@ -159,9 +166,9 @@ export class Model {
private onDidChangeVisibleTextEditors(editors: TextEditor[]): void {
const config = workspace.getConfiguration('git');
const enabled = config.get<boolean>('autoRepositoryDetection') === true;
const autoRepositoryDetection = config.get<boolean | 'subFolders' | 'openEditors'>('autoRepositoryDetection');
if (!enabled) {
if (autoRepositoryDetection !== true && autoRepositoryDetection !== 'openEditors') {
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册