Files
Test/Library/PackageCache/com.unity.collab-proxy@4628d2ba6ea4/Editor/Assistant/Tools/BranchTools.cs
T
2026-11-01 23:39:55 +02:00

47 lines
1.5 KiB
C#

#if AIA_PRESENT
using System.Threading.Tasks;
using Codice.CM.Common;
namespace Unity.PlasticSCM.Editor.Assistant.Tools
{
static class BranchTools
{
internal static async Task<BranchInfo> GetBranchInfo(
string branchName)
{
var wkInfo = await UVCSToolContext.GetCurrentWorkspaceAsync();
return await UnityVersionControlApiProvider.Instance.GetBranchInfo(wkInfo, branchName);
}
internal static async Task CreateBranch(
string branchName,
string comment = null,
string parentBranchName = null,
long changesetId = -1)
{
var wkInfo = await UVCSToolContext.GetCurrentWorkspaceAsync();
await UnityVersionControlApiProvider.Instance.CreateBranch(wkInfo, branchName, comment, parentBranchName, changesetId);
}
internal static async Task RenameBranch(
string branchName,
string newBranchName)
{
var wkInfo = await UVCSToolContext.GetCurrentWorkspaceAsync();
await UnityVersionControlApiProvider.Instance.RenameBranch(wkInfo, branchName, newBranchName);
}
internal static async Task LaunchSwitchToBranchUI(
string branchName)
{
var wkInfo = await UVCSToolContext.GetCurrentWorkspaceAsync();
await UnityVersionControlApiProvider.Instance.LaunchSwitchToBranchUI(wkInfo, branchName);
}
}
}
#endif