From d32b20834fd2e18fecb82367ce74a154ff241d57 Mon Sep 17 00:00:00 2001 From: Vinicius Alberkovics Date: Sat, 14 Sep 2019 16:11:14 -0300 Subject: [PATCH] fix project without git --- GitAutoFetch/AutoFetch.cs | 15 +++++++++------ GitAutoFetch/source.extension.vsixmanifest | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/GitAutoFetch/AutoFetch.cs b/GitAutoFetch/AutoFetch.cs index 5f334aa..fdcbc04 100644 --- a/GitAutoFetch/AutoFetch.cs +++ b/GitAutoFetch/AutoFetch.cs @@ -104,17 +104,20 @@ private async void ExecCmd() { try { - while (true) + while (!DisposeGit) { - if (DisposeGit) - break; - DTE dte = await package.GetServiceAsync(typeof(DTE)).ConfigureAwait(false) as DTE; if (dte != null && dte.Solution.IsOpen) { - string solutionDir = Path.GetDirectoryName(dte.Solution.FullName); - dte.ExecuteCommand("Team.Git.Fetch"); + try + { + dte.ExecuteCommand("Team.Git.Fetch"); + } + catch (Exception) + { + break; + } } Thread.Sleep(TimeSpan.FromMinutes(Config.TimeValue())); } diff --git a/GitAutoFetch/source.extension.vsixmanifest b/GitAutoFetch/source.extension.vsixmanifest index 3871508..60810c6 100644 --- a/GitAutoFetch/source.extension.vsixmanifest +++ b/GitAutoFetch/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + GitAutoFetch Auto fetch in Git, menu location in solution explorer (Git AutoFetch and Configure Fetching) Logo.png