This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/GitHub.TeamFoundation.14/Services Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public class VSGitExt : IVSGitExt
2424 readonly IGitHubServiceProvider serviceProvider ;
2525 readonly IVSUIContext context ;
2626 readonly ILocalRepositoryModelFactory repositoryFactory ;
27+ readonly object refreshLock = new object ( ) ;
2728
2829 IGitExt gitService ;
2930 IReadOnlyList < ILocalRepositoryModel > activeRepositories ;
@@ -98,12 +99,15 @@ void RefreshActiveRepositories()
9899 {
99100 try
100101 {
101- log . Debug (
102- "IGitExt.ActiveRepositories (#{Id}) returned {Repositories}" ,
103- gitService . GetHashCode ( ) ,
104- gitService ? . ActiveRepositories . Select ( x => x . RepositoryPath ) ) ;
102+ lock ( refreshLock )
103+ {
104+ log . Debug (
105+ "IGitExt.ActiveRepositories (#{Id}) returned {Repositories}" ,
106+ gitService . GetHashCode ( ) ,
107+ gitService ? . ActiveRepositories . Select ( x => x . RepositoryPath ) ) ;
105108
106- ActiveRepositories = gitService ? . ActiveRepositories . Select ( x => repositoryFactory . Create ( x . RepositoryPath ) ) . ToList ( ) ;
109+ ActiveRepositories = gitService ? . ActiveRepositories . Select ( x => repositoryFactory . Create ( x . RepositoryPath ) ) . ToList ( ) ;
110+ }
107111 }
108112 catch ( Exception e )
109113 {
You can’t perform that action at this time.
0 commit comments