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

Commit bae6029

Browse files
Moving the property value check to the main thread
1 parent c29492c commit bae6029

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/GitHub.Api/Git/Repository.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -373,14 +373,14 @@ private void HandleBranchCacheUpdatedEvent(CacheUpdateEvent cacheUpdateEvent)
373373

374374
private void RepositoryManager_OnCurrentRemoteUpdated(ConfigRemote? remote)
375375
{
376-
if (!Nullable.Equals(CurrentConfigRemote, remote))
377-
{
378-
new ActionTask(CancellationToken.None, () => {
379-
CurrentConfigRemote = remote;
380-
CurrentRemote = GetGitRemote(remote.Value);
381-
UpdateRepositoryInfo();
382-
}) { Affinity = TaskAffinity.UI }.Start();
383-
}
376+
new ActionTask(CancellationToken.None, () => {
377+
if (!Nullable.Equals(CurrentConfigRemote, remote))
378+
{
379+
CurrentConfigRemote = remote;
380+
CurrentRemote = GetGitRemote(remote.Value);
381+
UpdateRepositoryInfo();
382+
}
383+
}) { Affinity = TaskAffinity.UI }.Start();
384384
}
385385

386386
private void RepositoryManager_OnRepositoryUpdated()
@@ -416,16 +416,16 @@ private void UpdateLocks()
416416

417417
private void RepositoryManager_OnCurrentBranchUpdated(ConfigBranch? branch)
418418
{
419-
if (!Nullable.Equals(CurrentConfigBranch, branch))
420-
{
421-
new ActionTask(CancellationToken.None, () => {
422-
var currentBranch = branch != null ? (GitBranch?)GetLocalGitBranch(branch.Value) : null;
419+
new ActionTask(CancellationToken.None, () => {
420+
if (!Nullable.Equals(CurrentConfigBranch, branch))
421+
{
422+
var currentBranch = branch != null ? (GitBranch?)GetLocalGitBranch(branch.Value) : null;
423423

424-
CurrentConfigBranch = branch;
425-
CurrentBranch = currentBranch;
426-
UpdateLocalBranches();
427-
}) { Affinity = TaskAffinity.UI }.Start();
428-
}
424+
CurrentConfigBranch = branch;
425+
CurrentBranch = currentBranch;
426+
UpdateLocalBranches();
427+
}
428+
}) { Affinity = TaskAffinity.UI }.Start();
429429
}
430430

431431
private void RepositoryManager_OnLocalBranchUpdated(string name)

0 commit comments

Comments
 (0)