optimize<LFS>: do NOT test LFS filter when LFS is not enabled

This commit is contained in:
leo 2021-06-07 14:14:53 +08:00
parent 2cb93d5a86
commit 9d6a411887
10 changed files with 67 additions and 33 deletions

View file

@ -13,7 +13,7 @@ namespace SourceGit.Commands {
var tmp = Path.GetTempFileName();
var cmd = $"\"{Models.Preference.Instance.Git.Path}\" --no-pager ";
var isLFS = new IsLFSFiltered(repo, path).Result();
var isLFS = new LFS(repo).IsFiltered(path);
if (isLFS) {
cmd += $"show {sha}:\"{path}\" > {tmp}.lfs\n";
cmd += $"\"{Models.Preference.Instance.Git.Path}\" --no-pager lfs smudge < {tmp}.lfs > \"{saveTo}\"\n";