Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit a1c2c28

Browse files
Updating view fields only when the corresponding cache changes
1 parent 1f89747 commit a1c2c28

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesView.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,19 +251,26 @@ private void MaybeUpdateData()
251251
currentBranch = string.Format("[{0}]", Repository.CurrentBranchName);
252252
}
253253

254-
if (currentStatusEntriesHasUpdate || currentLocksHasUpdate)
254+
if (currentLocksHasUpdate)
255255
{
256-
currentStatusEntriesHasUpdate = false;
257-
currentLocksHasUpdate = false;
258-
259256
gitLocks = new HashSet<NPath>(Repository.CurrentLocks.Select(gitLock => gitLock.Path));
257+
}
258+
259+
if (currentStatusEntriesHasUpdate)
260+
{
260261
gitStatusEntries = Repository.CurrentChanges.Where(x => x.Status != GitFileStatus.Ignored).ToList();
261262

262263
changedFilesText = gitStatusEntries.Count == 0
263264
? NoChangedFilesLabel
264265
: gitStatusEntries.Count == 1
265266
? OneChangedFileLabel
266267
: String.Format(ChangedFilesLabel, gitStatusEntries.Count);
268+
}
269+
270+
if (currentStatusEntriesHasUpdate || currentLocksHasUpdate)
271+
{
272+
currentStatusEntriesHasUpdate = false;
273+
currentLocksHasUpdate = false;
267274

268275
BuildTree();
269276
}

0 commit comments

Comments
 (0)