@@ -58,6 +58,8 @@ public static BranchItem[] GetBranchesNames(string? path)
58
58
59
59
public static async Task < bool > Checkout ( string ? repositoryPath , string ? branch )
60
60
{
61
+ Analytics . TrackEvent ( "Triggered git checkout" ) ;
62
+
61
63
if ( string . IsNullOrWhiteSpace ( repositoryPath ) || ! Repository . IsValid ( repositoryPath ) )
62
64
return false ;
63
65
@@ -69,8 +71,6 @@ public static async Task<bool> Checkout(string? repositoryPath, string? branch)
69
71
var options = new CheckoutOptions ( ) ;
70
72
var isBringingChanges = false ;
71
73
72
- Analytics . TrackEvent ( "Triggered git checkout" ) ;
73
-
74
74
if ( repository . RetrieveStatus ( ) . IsDirty )
75
75
{
76
76
var dialog = DynamicDialogFactory . GetFor_GitCheckoutConflicts ( checkoutBranch . FriendlyName , repository . Head . FriendlyName ) ;
@@ -120,6 +120,8 @@ public static async Task<bool> Checkout(string? repositoryPath, string? branch)
120
120
121
121
public static async Task CreateNewBranch ( string repositoryPath , string activeBranch )
122
122
{
123
+ Analytics . TrackEvent ( "Triggered create git branch" ) ;
124
+
123
125
var viewModel = new AddBranchDialogViewModel ( repositoryPath , activeBranch ) ;
124
126
var dialog = Ioc . Default . GetRequiredService < IDialogService > ( ) . GetDialog ( viewModel ) ;
125
127
@@ -133,8 +135,6 @@ public static async Task CreateNewBranch(string repositoryPath, string activeBra
133
135
if ( repository . Head . FriendlyName . Equals ( viewModel . NewBranchName ) ||
134
136
await Checkout ( repositoryPath , viewModel . BasedOn ) )
135
137
{
136
- Analytics . TrackEvent ( $ "Triggered git branch") ;
137
-
138
138
repository . CreateBranch ( viewModel . NewBranchName ) ;
139
139
140
140
if ( viewModel . Checkout )
0 commit comments