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

Commit 88a0670

Browse files
Preventing updating locks when there is no remote
1 parent a66bd28 commit 88a0670

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/GitHub.Api/Git/Repository.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private void CacheContainer_OnCacheInvalidated(CacheType cacheType)
267267
break;
268268

269269
case CacheType.GitLocksCache:
270-
repositoryManager?.UpdateLocks();
270+
UpdateLocks();
271271
break;
272272

273273
case CacheType.GitUserCache:
@@ -401,6 +401,16 @@ private void RepositoryManagerOnLocalBranchesUpdated(Dictionary<string, ConfigBr
401401
}) { Affinity = TaskAffinity.UI }.Start();
402402
}
403403

404+
private void UpdateLocks()
405+
{
406+
if (string.IsNullOrEmpty(CurrentRemote?.Url))
407+
{
408+
return;
409+
}
410+
411+
repositoryManager?.UpdateLocks();
412+
}
413+
404414
private void UpdateLocalBranches()
405415
{
406416
LocalBranches = LocalConfigBranches.Values.Select(GetLocalGitBranch).ToArray();

0 commit comments

Comments
 (0)