Skip to content

Commit 465170d

Browse files
committed
Updated checkout branch to return a Task.
1 parent d7387cc commit 465170d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Assets/Plugins/CandyCoded.GitStatus/Scripts/CustomEditor/Git.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ public static async Task<string[]> ChangedFiles()
7878

7979
}
8080

81-
public static void CheckoutBranch(string branch)
81+
public static async Task CheckoutBranch(string branch)
8282
{
8383

84-
GenerateProcess(GitPath, $"checkout {branch}");
84+
await GenerateProcess(GitPath, $"checkout {branch}");
8585

8686
}
8787

Assets/Plugins/CandyCoded.GitStatus/Scripts/CustomEditor/GitStatusPanel.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#if UNITY_EDITOR
44
using System;
5+
using System.Threading.Tasks;
56
using UnityEditor;
67
using UnityEngine;
78

@@ -53,7 +54,12 @@ private void OnGUI()
5354
else
5455
{
5556

56-
Git.CheckoutBranch(GitStatus.branches[selectedBranch]);
57+
Task.Run(async () =>
58+
{
59+
60+
await Git.CheckoutBranch(GitStatus.branches[selectedBranch]);
61+
62+
});
5763

5864
}
5965

0 commit comments

Comments
 (0)