Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #840 from github/fixes/800-vs2017-clone-api
Browse files Browse the repository at this point in the history
Use new clone API in VS2017.
  • Loading branch information
grokys authored Feb 13, 2017
2 parents 96b6941 + 0137bde commit d7359bc
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 2 deletions.
Binary file modified lib/15.0/Microsoft.TeamFoundation.Client.dll
Binary file not shown.
Binary file modified lib/15.0/Microsoft.TeamFoundation.Common.dll
Binary file not shown.
Binary file modified lib/15.0/Microsoft.TeamFoundation.Controls.dll
Binary file not shown.
Binary file modified lib/15.0/Microsoft.TeamFoundation.Git.Client.dll
Binary file not shown.
Binary file modified lib/15.0/Microsoft.TeamFoundation.Git.Controls.dll
Binary file not shown.
Binary file modified lib/15.0/Microsoft.TeamFoundation.Git.Provider.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions src/GitHub.TeamFoundation.14/GitHub.TeamFoundation.14.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG;TEAMEXPLORER14</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>TRACE;TEAMEXPLORER14</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
Expand Down
15 changes: 15 additions & 0 deletions src/GitHub.TeamFoundation.14/Services/VSGitServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
using GitHub.TeamFoundation;
using Microsoft.TeamFoundation.Git.Controls.Extensibility;
using Microsoft.VisualStudio.TeamFoundation.Git.Extensibility;
using Microsoft.VisualStudio.Shell;
using System.Threading;

namespace GitHub.Services
{
Expand All @@ -21,6 +23,7 @@ namespace GitHub.Services
public class VSGitServices : IVSGitServices
{
readonly IGitHubServiceProvider serviceProvider;
readonly IVsStatusbar statusBar;

/// <summary>
/// This MEF export requires specific versions of TeamFoundation. IGitExt is declared here so
Expand All @@ -34,6 +37,7 @@ public class VSGitServices : IVSGitServices
public VSGitServices(IGitHubServiceProvider serviceProvider)
{
this.serviceProvider = serviceProvider;
this.statusBar = serviceProvider.GetService<IVsStatusbar>();
}

// The Default Repository Path that VS uses is hidden in an internal
Expand All @@ -57,8 +61,19 @@ public string GetLocalClonePathFromGitProvider()

public void Clone(string cloneUrl, string clonePath, bool recurseSubmodules)
{
#if TEAMEXPLORER14
var gitExt = serviceProvider.GetService<IGitRepositoriesExt>();
gitExt.Clone(cloneUrl, clonePath, recurseSubmodules ? CloneOptions.RecurseSubmodule : CloneOptions.None);
#else
var gitExt = serviceProvider.GetService<IGitActionsExt>();
var progress = new Progress<ServiceProgressData>();

ThreadHelper.JoinableTaskFactory.RunAsync(async () =>
{
progress.ProgressChanged += (s, e) => statusBar.SetText(e.ProgressText);
await gitExt.CloneAsync(cloneUrl, clonePath, recurseSubmodules, default(CancellationToken), progress);
});
#endif
}

IGitRepositoryInfo GetRepoFromVS()
Expand Down
25 changes: 25 additions & 0 deletions src/GitHub.TeamFoundation.15/GitHub.TeamFoundation.15.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,22 @@
<HintPath>..\..\packages\VSSDK.ComponentModelHost.12.0.4\lib\net45\Microsoft.VisualStudio.ComponentModelHost.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.VisualStudio.CoreUtility.15.0.26201\lib\net45\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.14.0.14.3.25407\lib\Microsoft.VisualStudio.Shell.14.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Framework.15.0.26201\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
<Private>True</Private>
Expand All @@ -85,6 +97,18 @@
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Threading, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.VisualStudio.Threading.15.0.240\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.VisualStudio.Utilities.15.0.26201\lib\net45\Microsoft.VisualStudio.Utilities.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NullGuard, Version=1.4.6.0, Culture=neutral, PublicKeyToken=1958ac8092168428, processorArchitecture=MSIL">
<HintPath>..\..\packages\NullGuard.Fody.1.4.6\Lib\dotnet\NullGuard.dll</HintPath>
<Private>False</Private>
Expand Down Expand Up @@ -189,6 +213,7 @@
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand Down
19 changes: 19 additions & 0 deletions src/GitHub.TeamFoundation.15/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Utilities" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
6 changes: 6 additions & 0 deletions src/GitHub.TeamFoundation.15/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
<package id="Fody" version="1.29.4" targetFramework="net461" developmentDependency="true" />
<package id="LibGit2Sharp" version="0.22.0" targetFramework="net461" />
<package id="LibGit2Sharp.NativeBinaries" version="1.0.129" targetFramework="net461" />
<package id="Microsoft.VisualStudio.CoreUtility" version="15.0.26201" targetFramework="net461" />
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6070" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.14.0" version="14.3.25407" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Framework" version="15.0.26201" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Immutable.10.0" version="10.0.30319" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Interop" version="7.10.6071" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Interop.8.0" version="8.0.50727" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Threading" version="15.0.240" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Utilities" version="15.0.26201" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Validation" version="15.0.82" targetFramework="net461" />
<package id="NullGuard.Fody" version="1.4.6" targetFramework="net461" developmentDependency="true" />
<package id="Rx-Core" version="2.2.5-custom" targetFramework="net45" />
<package id="Rx-Interfaces" version="2.2.5-custom" targetFramework="net45" />
Expand Down

0 comments on commit d7359bc

Please sign in to comment.