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

@ -11,10 +11,12 @@ namespace SourceGit.Views {
public partial class Histories : Window {
private string repo = null;
private string file = null;
private bool isLFSEnabled = false;
public Histories(string repo, string file) {
this.repo = repo;
this.file = file;
this.isLFSEnabled = new Commands.LFS(repo).IsEnabled();
InitializeComponent();
@ -57,7 +59,8 @@ namespace SourceGit.Views {
diffViewer.Diff(repo, new Widgets.DiffViewer.Option() {
RevisionRange = new string[] { start, commit.SHA },
Path = file
Path = file,
UseLFS = isLFSEnabled,
});
}