Skip to content

Commit 052e010

Browse files
authored
Analytics: Fixed git events (#12423)
1 parent 4ea05b3 commit 052e010

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Files.App/Helpers/GitHelpers.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ public static BranchItem[] GetBranchesNames(string? path)
5858

5959
public static async Task<bool> Checkout(string? repositoryPath, string? branch)
6060
{
61+
Analytics.TrackEvent("Triggered git checkout");
62+
6163
if (string.IsNullOrWhiteSpace(repositoryPath) || !Repository.IsValid(repositoryPath))
6264
return false;
6365

@@ -69,8 +71,6 @@ public static async Task<bool> Checkout(string? repositoryPath, string? branch)
6971
var options = new CheckoutOptions();
7072
var isBringingChanges = false;
7173

72-
Analytics.TrackEvent("Triggered git checkout");
73-
7474
if (repository.RetrieveStatus().IsDirty)
7575
{
7676
var dialog = DynamicDialogFactory.GetFor_GitCheckoutConflicts(checkoutBranch.FriendlyName, repository.Head.FriendlyName);
@@ -120,6 +120,8 @@ public static async Task<bool> Checkout(string? repositoryPath, string? branch)
120120

121121
public static async Task CreateNewBranch(string repositoryPath, string activeBranch)
122122
{
123+
Analytics.TrackEvent("Triggered create git branch");
124+
123125
var viewModel = new AddBranchDialogViewModel(repositoryPath, activeBranch);
124126
var dialog = Ioc.Default.GetRequiredService<IDialogService>().GetDialog(viewModel);
125127

@@ -133,8 +135,6 @@ public static async Task CreateNewBranch(string repositoryPath, string activeBra
133135
if (repository.Head.FriendlyName.Equals(viewModel.NewBranchName) ||
134136
await Checkout(repositoryPath, viewModel.BasedOn))
135137
{
136-
Analytics.TrackEvent($"Triggered git branch");
137-
138138
repository.CreateBranch(viewModel.NewBranchName);
139139

140140
if (viewModel.Checkout)

0 commit comments

Comments
 (0)