@@ -10,7 +10,7 @@ class LfsLocksModificationProcessor : UnityEditor.AssetModificationProcessor
1010 private static ILogging Logger = LogHelper . GetLogger < LfsLocksModificationProcessor > ( ) ;
1111 private static IRepository repository ;
1212 private static IPlatform platform ;
13- private static List < GitLock > locks = new List < GitLock > ( ) ;
13+ private static Dictionary < string , GitLock > locks = new Dictionary < string , GitLock > ( ) ;
1414 private static CacheUpdateEvent lastLocksChangedEvent ;
1515
1616 public static void Initialize ( IRepository repo , IPlatform plat )
@@ -75,7 +75,7 @@ private static void RepositoryOnLocksChanged(CacheUpdateEvent cacheUpdateEvent)
7575 if ( ! lastLocksChangedEvent . Equals ( cacheUpdateEvent ) )
7676 {
7777 lastLocksChangedEvent = cacheUpdateEvent ;
78- locks = repository . CurrentLocks ;
78+ locks = repository . CurrentLocks . ToDictionary ( gitLock => gitLock . Path ) ;
7979 }
8080 }
8181
@@ -90,11 +90,11 @@ private static bool IsLocked(string assetPath)
9090 if ( repository != null )
9191 {
9292 var repositoryPath = EntryPoint . Environment . GetRepositoryPath ( assetPath . ToNPath ( ) ) ;
93- var lck = locks . FirstOrDefault ( @lock => @lock . Path == repositoryPath ) ;
94- if ( ! lck . Equals ( GitLock . Default ) )
93+ GitLock lck ;
94+ if ( locks . TryGetValue ( repositoryPath , out lck ) )
9595 {
9696 var user = platform . Keychain . Connections . FirstOrDefault ( ) ;
97- if ( ! lck . User . Equals ( user ) )
97+ if ( ! lck . User . Equals ( user . Username ) )
9898 {
9999 gitLock = lck ;
100100 }
0 commit comments