diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs index d228a361e..0a0106267 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs @@ -26,7 +26,7 @@ class ProjectWindowInterface : AssetPostprocessor private static CacheUpdateEvent lastRepositoryStatusChangedEvent; private static CacheUpdateEvent lastLocksChangedEvent; private static IRepository Repository { get { return manager != null ? manager.Environment.Repository : null; } } - private static bool IsInitialized { get { return Repository != null && Repository.CurrentRemote.HasValue; } } + private static bool IsInitialized { get { return Repository != null; } } public static void Initialize(IApplicationManager theManager) { @@ -67,6 +67,7 @@ private static void RepositoryOnStatusEntriesChanged(CacheUpdateEvent cacheUpdat if (!lastRepositoryStatusChangedEvent.Equals(cacheUpdateEvent)) { lastRepositoryStatusChangedEvent = cacheUpdateEvent; + AssetDatabase.Refresh(); entries.Clear(); entries.AddRange(Repository.CurrentChanges); OnStatusUpdate(); @@ -88,6 +89,8 @@ private static bool ContextMenu_CanLock() { if (!EnsureInitialized()) return false; + if(!Repository.CurrentRemote.HasValue) + return false; if (isBusy) return false; return Selection.objects.Any(IsObjectUnlocked); @@ -98,6 +101,8 @@ private static bool ContextMenu_CanUnlock() { if (!EnsureInitialized()) return false; + if (!Repository.CurrentRemote.HasValue) + return false; if (isBusy) return false; return Selection.objects.Any(IsObjectLocked); @@ -108,6 +113,8 @@ private static bool ContextMenu_CanUnlockForce() { if (!EnsureInitialized()) return false; + if (!Repository.CurrentRemote.HasValue) + return false; if (isBusy) return false; return Selection.objects.Any(IsObjectLocked);