mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
enhance: only show tracking options when file is not tracked by GIT LFS
This commit is contained in:
parent
4ce3d73d61
commit
e17e4b9a53
1 changed files with 27 additions and 22 deletions
|
@ -618,6 +618,9 @@ namespace SourceGit.ViewModels
|
|||
lfs.Header = App.Text("GitLFS");
|
||||
lfs.Icon = App.CreateMenuIcon("Icons.LFS");
|
||||
|
||||
var isLFSFiltered = new Commands.IsLFSFiltered(_repo.FullPath, change.Path).Result();
|
||||
if (!isLFSFiltered)
|
||||
{
|
||||
var filename = Path.GetFileName(change.Path);
|
||||
var lfsTrackThisFile = new MenuItem();
|
||||
lfsTrackThisFile.Header = App.Text("GitLFS.Track", filename);
|
||||
|
@ -646,6 +649,9 @@ namespace SourceGit.ViewModels
|
|||
lfs.Items.Add(lfsTrackByExtension);
|
||||
}
|
||||
|
||||
lfs.Items.Add(new MenuItem() { Header = "-" });
|
||||
}
|
||||
|
||||
var lfsLock = new MenuItem();
|
||||
lfsLock.Header = App.Text("GitLFS.Locks.Lock");
|
||||
lfsLock.Icon = App.CreateMenuIcon("Icons.Lock");
|
||||
|
@ -657,7 +663,6 @@ namespace SourceGit.ViewModels
|
|||
|
||||
e.Handled = true;
|
||||
};
|
||||
lfs.Items.Add(new MenuItem() { Header = "-" });
|
||||
lfs.Items.Add(lfsLock);
|
||||
|
||||
var lfsUnlock = new MenuItem();
|
||||
|
|
Loading…
Reference in a new issue