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

Commit d7359bc

Browse files
authored
Merge pull request #840 from github/fixes/800-vs2017-clone-api
Use new clone API in VS2017.
2 parents 96b6941 + 0137bde commit d7359bc

11 files changed

+67
-2
lines changed
-15.5 KB
Binary file not shown.
-62 KB
Binary file not shown.
Binary file not shown.
512 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/GitHub.TeamFoundation.14/GitHub.TeamFoundation.14.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
<DebugSymbols>true</DebugSymbols>
2525
<DebugType>full</DebugType>
2626
<Optimize>false</Optimize>
27-
<DefineConstants>DEBUG;TRACE</DefineConstants>
27+
<DefineConstants>TRACE;DEBUG;TEAMEXPLORER14</DefineConstants>
2828
<ErrorReport>prompt</ErrorReport>
2929
<WarningLevel>4</WarningLevel>
3030
</PropertyGroup>
3131
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3232
<DebugType>pdbonly</DebugType>
3333
<Optimize>true</Optimize>
34-
<DefineConstants>TRACE</DefineConstants>
34+
<DefineConstants>TRACE;TEAMEXPLORER14</DefineConstants>
3535
<ErrorReport>prompt</ErrorReport>
3636
<WarningLevel>4</WarningLevel>
3737
</PropertyGroup>

src/GitHub.TeamFoundation.14/Services/VSGitServices.cs

+15
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
using GitHub.TeamFoundation;
1313
using Microsoft.TeamFoundation.Git.Controls.Extensibility;
1414
using Microsoft.VisualStudio.TeamFoundation.Git.Extensibility;
15+
using Microsoft.VisualStudio.Shell;
16+
using System.Threading;
1517

1618
namespace GitHub.Services
1719
{
@@ -21,6 +23,7 @@ namespace GitHub.Services
2123
public class VSGitServices : IVSGitServices
2224
{
2325
readonly IGitHubServiceProvider serviceProvider;
26+
readonly IVsStatusbar statusBar;
2427

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

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

5862
public void Clone(string cloneUrl, string clonePath, bool recurseSubmodules)
5963
{
64+
#if TEAMEXPLORER14
6065
var gitExt = serviceProvider.GetService<IGitRepositoriesExt>();
6166
gitExt.Clone(cloneUrl, clonePath, recurseSubmodules ? CloneOptions.RecurseSubmodule : CloneOptions.None);
67+
#else
68+
var gitExt = serviceProvider.GetService<IGitActionsExt>();
69+
var progress = new Progress<ServiceProgressData>();
70+
71+
ThreadHelper.JoinableTaskFactory.RunAsync(async () =>
72+
{
73+
progress.ProgressChanged += (s, e) => statusBar.SetText(e.ProgressText);
74+
await gitExt.CloneAsync(cloneUrl, clonePath, recurseSubmodules, default(CancellationToken), progress);
75+
});
76+
#endif
6277
}
6378

6479
IGitRepositoryInfo GetRepoFromVS()

src/GitHub.TeamFoundation.15/GitHub.TeamFoundation.15.csproj

+25
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,22 @@
6969
<HintPath>..\..\packages\VSSDK.ComponentModelHost.12.0.4\lib\net45\Microsoft.VisualStudio.ComponentModelHost.dll</HintPath>
7070
<Private>False</Private>
7171
</Reference>
72+
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
73+
<HintPath>..\..\packages\Microsoft.VisualStudio.CoreUtility.15.0.26201\lib\net45\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
74+
<Private>True</Private>
75+
</Reference>
76+
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
77+
<HintPath>..\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>
78+
<Private>True</Private>
79+
</Reference>
7280
<Reference Include="Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
7381
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.14.0.14.3.25407\lib\Microsoft.VisualStudio.Shell.14.0.dll</HintPath>
7482
<Private>True</Private>
7583
</Reference>
84+
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
85+
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Framework.15.0.26201\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll</HintPath>
86+
<Private>True</Private>
87+
</Reference>
7688
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
7789
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
7890
<Private>True</Private>
@@ -85,6 +97,18 @@
8597
<HintPath>..\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
8698
<Private>True</Private>
8799
</Reference>
100+
<Reference Include="Microsoft.VisualStudio.Threading, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
101+
<HintPath>..\..\packages\Microsoft.VisualStudio.Threading.15.0.240\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath>
102+
<Private>True</Private>
103+
</Reference>
104+
<Reference Include="Microsoft.VisualStudio.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
105+
<HintPath>..\..\packages\Microsoft.VisualStudio.Utilities.15.0.26201\lib\net45\Microsoft.VisualStudio.Utilities.dll</HintPath>
106+
<Private>True</Private>
107+
</Reference>
108+
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
109+
<HintPath>..\..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
110+
<Private>True</Private>
111+
</Reference>
88112
<Reference Include="NullGuard, Version=1.4.6.0, Culture=neutral, PublicKeyToken=1958ac8092168428, processorArchitecture=MSIL">
89113
<HintPath>..\..\packages\NullGuard.Fody.1.4.6\Lib\dotnet\NullGuard.dll</HintPath>
90114
<Private>False</Private>
@@ -189,6 +213,7 @@
189213
<Link>Properties\SolutionInfo.cs</Link>
190214
</Compile>
191215
<Compile Include="Properties\AssemblyInfo.cs" />
216+
<None Include="app.config" />
192217
<None Include="packages.config" />
193218
</ItemGroup>
194219
<ItemGroup>
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<runtime>
4+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5+
<dependentAssembly>
6+
<assemblyIdentity name="Microsoft.VisualStudio.Utilities" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
7+
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
8+
</dependentAssembly>
9+
<dependentAssembly>
10+
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
11+
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
12+
</dependentAssembly>
13+
<dependentAssembly>
14+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
15+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
16+
</dependentAssembly>
17+
</assemblyBinding>
18+
</runtime>
19+
</configuration>

src/GitHub.TeamFoundation.15/packages.config

+6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
<package id="Fody" version="1.29.4" targetFramework="net461" developmentDependency="true" />
44
<package id="LibGit2Sharp" version="0.22.0" targetFramework="net461" />
55
<package id="LibGit2Sharp.NativeBinaries" version="1.0.129" targetFramework="net461" />
6+
<package id="Microsoft.VisualStudio.CoreUtility" version="15.0.26201" targetFramework="net461" />
7+
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6070" targetFramework="net461" />
68
<package id="Microsoft.VisualStudio.Shell.14.0" version="14.3.25407" targetFramework="net461" />
9+
<package id="Microsoft.VisualStudio.Shell.Framework" version="15.0.26201" targetFramework="net461" />
710
<package id="Microsoft.VisualStudio.Shell.Immutable.10.0" version="10.0.30319" targetFramework="net461" />
811
<package id="Microsoft.VisualStudio.Shell.Interop" version="7.10.6071" targetFramework="net461" />
912
<package id="Microsoft.VisualStudio.Shell.Interop.8.0" version="8.0.50727" targetFramework="net461" />
13+
<package id="Microsoft.VisualStudio.Threading" version="15.0.240" targetFramework="net461" />
14+
<package id="Microsoft.VisualStudio.Utilities" version="15.0.26201" targetFramework="net461" />
15+
<package id="Microsoft.VisualStudio.Validation" version="15.0.82" targetFramework="net461" />
1016
<package id="NullGuard.Fody" version="1.4.6" targetFramework="net461" developmentDependency="true" />
1117
<package id="Rx-Core" version="2.2.5-custom" targetFramework="net45" />
1218
<package id="Rx-Interfaces" version="2.2.5-custom" targetFramework="net45" />

0 commit comments

Comments
 (0)