mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Merge branch 'newAutoRepositoryDetection' of https://github.com/BattleBas/vscode into BattleBas-newAutoRepositoryDetection
This commit is contained in:
@@ -904,9 +904,18 @@ export class Repository implements Disposable {
|
||||
const index: Resource[] = [];
|
||||
const workingTree: Resource[] = [];
|
||||
const merge: Resource[] = [];
|
||||
const repoDetection = config.get<boolean>('autoRepositoryDetection') === true;
|
||||
|
||||
status.forEach(raw => {
|
||||
const uri = Uri.file(path.join(this.repository.root, raw.path));
|
||||
const fullFilePath = path.join(this.repository.root, raw.path);
|
||||
|
||||
if (!repoDetection && workspace.workspaceFolders === undefined) {
|
||||
if (!this.detectActiveFile(fullFilePath)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const uri = Uri.file(fullFilePath);
|
||||
const renameUri = raw.rename ? Uri.file(path.join(this.repository.root, raw.rename)) : undefined;
|
||||
|
||||
switch (raw.x + raw.y) {
|
||||
@@ -964,6 +973,10 @@ export class Repository implements Disposable {
|
||||
this._onDidChangeStatus.fire();
|
||||
}
|
||||
|
||||
private detectActiveFile(fullFilePath: string): boolean | undefined {
|
||||
return window.activeTextEditor && window.activeTextEditor.document.fileName === fullFilePath;
|
||||
}
|
||||
|
||||
private onFSChange(uri: Uri): void {
|
||||
const config = workspace.getConfiguration('git');
|
||||
const autorefresh = config.get<boolean>('autorefresh');
|
||||
|
||||
Reference in New Issue
Block a user