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

Commit 835baa3

Browse files
committed
Make sure things are called at the end of tasks
1 parent 9372ce7 commit 835baa3

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -693,15 +693,6 @@ private void Pull()
693693
{
694694
Repository
695695
.Pull()
696-
// we need the error propagated from the original git command to handle things appropriately
697-
.Then(success => {
698-
if (!success)
699-
{
700-
// if Pull fails we need to parse the output of the command, figure out
701-
// whether pull triggered a merge or a rebase, and abort the operation accordingly
702-
// (either git rebase --abort or git merge --abort)
703-
}
704-
}, runOptions: TaskRunOptions.OnAlways)
705696
.FinallyInUI((success, e) => {
706697
if (success)
707698
{

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,12 @@ private static void ContextMenu_Lock()
107107

108108
repository
109109
.RequestLock(repositoryPath)
110-
.ThenInUI(_ =>
110+
.FinallyInUI((success, ex) =>
111111
{
112-
EntryPoint.ApplicationManager.TaskManager.Run(EntryPoint.ApplicationManager.UsageTracker.IncrementAssetExplorerContextMenuLfsLock);
112+
if (success)
113+
{
114+
EntryPoint.ApplicationManager.TaskManager.Run(EntryPoint.ApplicationManager.UsageTracker.IncrementAssetExplorerContextMenuLfsLock);
115+
}
113116

114117
isBusy = false;
115118
Selection.activeGameObject = null;
@@ -150,10 +153,12 @@ private static void ContextMenu_Unlock()
150153

151154
repository
152155
.ReleaseLock(repositoryPath, false)
153-
.ThenInUI(_ =>
156+
.FinallyInUI((success, ex) =>
154157
{
155-
EntryPoint.ApplicationManager.TaskManager.Run(EntryPoint.ApplicationManager.UsageTracker.IncrementAssetExplorerContextMenuLfsUnlock);
156-
158+
if (success)
159+
{
160+
EntryPoint.ApplicationManager.TaskManager.Run(EntryPoint.ApplicationManager.UsageTracker.IncrementAssetExplorerContextMenuLfsUnlock);
161+
}
157162
isBusy = false;
158163
Selection.activeGameObject = null;
159164
EditorApplication.RepaintProjectWindow();

0 commit comments

Comments
 (0)