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

Commit c22472d

Browse files
committed
Do not call GitClient directly
1 parent 1b48431 commit c22472d

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ private void OnButtonBarGUI()
304304
// Effectuate create
305305
if (createBranch)
306306
{
307-
GitClient.CreateBranch(newBranchName, treeLocals.SelectedNode.Path)
307+
Repository.CreateBranch(newBranchName, treeLocals.SelectedNode.Path)
308308
.FinallyInUI((success, e) =>
309309
{
310310
if (success)
@@ -474,7 +474,7 @@ private void CheckoutRemoteBranch(string branch)
474474

475475
if (confirmCheckout)
476476
{
477-
GitClient.CreateBranch(branchName, branch)
477+
Repository.CreateBranch(branchName, branch)
478478
.FinallyInUI((success, e) =>
479479
{
480480
if (success)
@@ -497,7 +497,7 @@ private void SwitchBranch(string branch)
497497
if (EditorUtility.DisplayDialog(ConfirmSwitchTitle, String.Format(ConfirmSwitchMessage, branch), ConfirmSwitchOK,
498498
ConfirmSwitchCancel))
499499
{
500-
GitClient.SwitchBranch(branch)
500+
Repository.SwitchBranch(branch)
501501
.FinallyInUI((success, e) =>
502502
{
503503
if (success)
@@ -519,14 +519,8 @@ private void DeleteLocalBranch(string branch)
519519
var dialogMessage = string.Format(DeleteBranchMessageFormatString, branch);
520520
if (EditorUtility.DisplayDialog(DeleteBranchTitle, dialogMessage, DeleteBranchButton, CancelButtonLabel))
521521
{
522-
GitClient.DeleteBranch(branch, true)
523-
.FinallyInUI((success, e) =>
524-
{
525-
if (success)
526-
{
527-
TaskManager.Run(UsageTracker.IncrementBranchesViewButtonDeleteBranch);
528-
}
529-
})
522+
Repository.DeleteBranch(branch, true)
523+
.Then(UsageTracker.IncrementBranchesViewButtonDeleteBranch)
530524
.Start();
531525
}
532526
}

0 commit comments

Comments
 (0)