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

Commit

Permalink
Merge pull request #304 from github-for-unity/fixes/lock-status-updates
Browse files Browse the repository at this point in the history
Fix to correctly update LFS lock status
  • Loading branch information
StanleyGoldman authored Sep 12, 2017
2 parents d5f6500 + c680e8c commit acc6efc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/GitHub.Api/Git/RepositoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,16 +312,16 @@ public ITask LockFile(string file)
{
var task = GitClient.Lock(file);
HookupHandlers(task);
ListLocks(false);
return task;

return task.Then(ListLocks(false));
}

public ITask UnlockFile(string file, bool force)
{
var task = GitClient.Unlock(file, force);
HookupHandlers(task).Schedule(taskManager);
ListLocks(false);
return task;

return task.Then(ListLocks(false));
}

private void LoadGitUser()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class ProjectWindowInterface : AssetPostprocessor

public static void Initialize(IRepository repo)
{
Logger.Trace("Initialize HasRepository:{0}", repo != null);

EditorApplication.projectWindowItemOnGUI -= OnProjectWindowItemGUI;
EditorApplication.projectWindowItemOnGUI += OnProjectWindowItemGUI;
initialized = true;
Expand Down Expand Up @@ -149,7 +151,9 @@ private static void Refresh()
private static void RunLocksUpdateOnMainThread(IEnumerable<GitLock> update)
{
new ActionTask(EntryPoint.ApplicationManager.TaskManager.Token, _ => OnLocksUpdate(update))
.ScheduleUI(EntryPoint.ApplicationManager.TaskManager);
{
Affinity = TaskAffinity.UI
}.Start();
}

private static void OnLocksUpdate(IEnumerable<GitLock> update)
Expand All @@ -169,11 +173,16 @@ private static void OnLocksUpdate(IEnumerable<GitLock> update)
var g = AssetDatabase.AssetPathToGUID(assetPath);
guidsLocks.Add(g);
}

EditorApplication.RepaintProjectWindow();
}

private static void RunStatusUpdateOnMainThread(GitStatus update)
{
EntryPoint.ApplicationManager.TaskManager.ScheduleUI(new ActionTask(EntryPoint.ApplicationManager.TaskManager.Token, _ => OnStatusUpdate(update)));
new ActionTask(EntryPoint.ApplicationManager.TaskManager.Token, _ => OnStatusUpdate(update))
{
Affinity = TaskAffinity.UI
}.Start();
}

private static void OnStatusUpdate(GitStatus update)
Expand Down

0 comments on commit acc6efc

Please sign in to comment.