Skip to content

Commit 31ad317

Browse files
committed
feature: remember the Include Untracked Files toggle state in local changes
1 parent 5ec8279 commit 31ad317

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/Models/RepositorySettings.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ public string DefaultRemote
1414
set;
1515
} = string.Empty;
1616

17+
public bool IncludeUntrackedInLocalChanges
18+
{
19+
get;
20+
set;
21+
} = true;
22+
1723
public DealWithLocalChanges DealWithLocalChangesOnCheckoutBranch
1824
{
1925
get;

src/ViewModels/Repository.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,15 @@ public int StashesCount
206206

207207
public bool IncludeUntracked
208208
{
209-
get => _includeUntracked;
209+
get => _settings.IncludeUntrackedInLocalChanges;
210210
set
211211
{
212-
if (SetProperty(ref _includeUntracked, value))
212+
if (value != _settings.IncludeUntrackedInLocalChanges)
213+
{
214+
_settings.IncludeUntrackedInLocalChanges = value;
215+
OnPropertyChanged();
213216
Task.Run(RefreshWorkingCopyChanges);
217+
}
214218
}
215219
}
216220

@@ -918,7 +922,7 @@ public void RefreshSubmodules()
918922

919923
public void RefreshWorkingCopyChanges()
920924
{
921-
var changes = new Commands.QueryLocalChanges(_fullpath, _includeUntracked).Result();
925+
var changes = new Commands.QueryLocalChanges(_fullpath, _settings.IncludeUntrackedInLocalChanges).Result();
922926
if (_workingCopy == null)
923927
return;
924928

@@ -2299,7 +2303,6 @@ private void AutoFetchImpl(object sender)
22992303
private List<Models.Submodule> _submodules = new List<Models.Submodule>();
23002304
private List<Models.Submodule> _visibleSubmodules = new List<Models.Submodule>();
23012305

2302-
private bool _includeUntracked = true;
23032306
private Models.Commit _searchResultSelectedCommit = null;
23042307
private Timer _autoFetchTimer = null;
23052308
private DateTime _lastFetchTime = DateTime.MinValue;

0 commit comments

Comments
 (0)