mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
enhance: reduce repository scanning time (#728)
* skip special folders, such as `node_modules`, `.svn`, `.vs` .etc. * change max scanning depth to 5 Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
069dc255d1
commit
b407dd97a1
1 changed files with 8 additions and 1 deletions
|
@ -90,6 +90,13 @@ namespace SourceGit.ViewModels
|
||||||
var subdirs = dir.GetDirectories("*", opts);
|
var subdirs = dir.GetDirectories("*", opts);
|
||||||
foreach (var subdir in subdirs)
|
foreach (var subdir in subdirs)
|
||||||
{
|
{
|
||||||
|
if (subdir.Name.Equals("node_modules", StringComparison.Ordinal) ||
|
||||||
|
subdir.Name.Equals(".svn", StringComparison.Ordinal) ||
|
||||||
|
subdir.Name.Equals(".vs", StringComparison.Ordinal) ||
|
||||||
|
subdir.Name.Equals(".vscode", StringComparison.Ordinal) ||
|
||||||
|
subdir.Name.Equals(".idea", StringComparison.Ordinal))
|
||||||
|
continue;
|
||||||
|
|
||||||
SetProgressDescription($"Scanning {subdir.FullName}...");
|
SetProgressDescription($"Scanning {subdir.FullName}...");
|
||||||
|
|
||||||
var normalizedSelf = subdir.FullName.Replace("\\", "/");
|
var normalizedSelf = subdir.FullName.Replace("\\", "/");
|
||||||
|
@ -110,7 +117,7 @@ namespace SourceGit.ViewModels
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (depth < 8)
|
if (depth < 5)
|
||||||
GetUnmanagedRepositories(subdir, outs, opts, depth + 1);
|
GetUnmanagedRepositories(subdir, outs, opts, depth + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue