@@ -10,7 +10,7 @@ class LfsLocksModificationProcessor : UnityEditor.AssetModificationProcessor
10
10
private static ILogging Logger = LogHelper . GetLogger < LfsLocksModificationProcessor > ( ) ;
11
11
private static IRepository repository ;
12
12
private static IPlatform platform ;
13
- private static List < GitLock > locks = new List < GitLock > ( ) ;
13
+ private static Dictionary < string , GitLock > locks = new Dictionary < string , GitLock > ( ) ;
14
14
private static CacheUpdateEvent lastLocksChangedEvent ;
15
15
16
16
public static void Initialize ( IRepository repo , IPlatform plat )
@@ -75,7 +75,7 @@ private static void RepositoryOnLocksChanged(CacheUpdateEvent cacheUpdateEvent)
75
75
if ( ! lastLocksChangedEvent . Equals ( cacheUpdateEvent ) )
76
76
{
77
77
lastLocksChangedEvent = cacheUpdateEvent ;
78
- locks = repository . CurrentLocks ;
78
+ locks = repository . CurrentLocks . ToDictionary ( gitLock => gitLock . Path ) ;
79
79
}
80
80
}
81
81
@@ -90,11 +90,11 @@ private static bool IsLocked(string assetPath)
90
90
if ( repository != null )
91
91
{
92
92
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 ) )
95
95
{
96
96
var user = platform . Keychain . Connections . FirstOrDefault ( ) ;
97
- if ( ! lck . User . Equals ( user ) )
97
+ if ( ! lck . User . Equals ( user . Username ) )
98
98
{
99
99
gitLock = lck ;
100
100
}
0 commit comments