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

Commit 2068cbe

Browse files
committed
Removed GitHelper, it is a duplicate of GitRepositoryHelper
1 parent c7e7a8a commit 2068cbe

File tree

6 files changed

+154
-468
lines changed

6 files changed

+154
-468
lines changed

src/GitTools.Core.Tests/Git/GitHelperTests.cs renamed to src/GitTools.Core.Tests/Git/GitRepositoryHelperTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Shouldly;
77
using Testing;
88

9-
public class GitHelperTests
9+
public class GitRepositoryHelperTests
1010
{
1111
[Test]
1212
public void NormalisationOfPullRequestsWithFetch()
@@ -21,7 +21,7 @@ public void NormalisationOfPullRequestsWithFetch()
2121
using (var localFixture = fixture.CloneRepository())
2222
{
2323
localFixture.Checkout(commit.Sha);
24-
GitHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: false, currentBranch: string.Empty);
24+
GitRepositoryHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: false, currentBranch: string.Empty);
2525

2626
var normalisedPullBranch = localFixture.Repository.FindBranch("pull/3/merge");
2727
normalisedPullBranch.ShouldNotBe(null);
@@ -42,7 +42,7 @@ public void NormalisationOfPullRequestsWithoutFetch()
4242
using (var localFixture = fixture.CloneRepository())
4343
{
4444
localFixture.Checkout(commit.Sha);
45-
GitHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: true, currentBranch: "refs/pull/3/merge");
45+
GitRepositoryHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: true, currentBranch: "refs/pull/3/merge");
4646

4747
var normalisedPullBranch = localFixture.Repository.FindBranch("pull/3/merge");
4848
normalisedPullBranch.ShouldNotBe(null);
@@ -64,7 +64,7 @@ public void UpdatesLocalBranchesWhen()
6464
localFixture.Checkout("feature/foo");
6565
// Advance remote
6666
var advancedCommit = fixture.Repository.MakeACommit();
67-
GitHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: false, currentBranch: null);
67+
GitRepositoryHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: false, currentBranch: null);
6868

6969
var normalisedBranch = localFixture.Repository.FindBranch("feature/foo");
7070
normalisedBranch.ShouldNotBe(null);
@@ -90,7 +90,7 @@ public void UpdatesCurrentBranch()
9090
localFixture.Repository.Network.Fetch(localFixture.Repository.Network.Remotes["origin"]);
9191
localFixture.Repository.Checkout(advancedCommit.Sha);
9292
localFixture.Repository.DumpGraph();
93-
GitHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: false, currentBranch: "ref/heads/develop");
93+
GitRepositoryHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: false, currentBranch: "ref/heads/develop");
9494

9595
var normalisedBranch = localFixture.Repository.FindBranch("develop");
9696
normalisedBranch.ShouldNotBe(null);
@@ -123,7 +123,7 @@ public void ShouldNotChangeBranchWhenNormalizingTheDirectory()
123123
fixture.Checkout("feature/foo");
124124
fixture.Repository.MakeACommit();
125125

126-
GitHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: false, currentBranch: null);
126+
GitRepositoryHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: false, currentBranch: null);
127127

128128
localFixture.Repository.DumpGraph();
129129
localFixture.Repository.Head.Tip.Sha.ShouldBe(lastCommitOnDevelop.Sha);
Lines changed: 111 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,118 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.72\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.72\build\LibGit2Sharp.NativeBinaries.props')" />
4-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
5-
<PropertyGroup>
6-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8-
<ProjectGuid>{0834BE9B-5CDE-4CAB-A683-C70A7D91450B}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>GitTools.Tests</RootNamespace>
12-
<AssemblyName>GitTools.Core.Tests</AssemblyName>
13-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<LangVersion>5</LangVersion>
16-
<NuGetPackageImportStamp>
17-
</NuGetPackageImportStamp>
18-
</PropertyGroup>
19-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20-
<DebugSymbols>true</DebugSymbols>
21-
<DebugType>full</DebugType>
22-
<Optimize>false</Optimize>
23-
<OutputPath>..\..\output\debug\GitTools.Core.Tests\net45\</OutputPath>
24-
<DefineConstants>TRACE;DEBUG</DefineConstants>
25-
<ErrorReport>prompt</ErrorReport>
26-
<WarningLevel>4</WarningLevel>
27-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
28-
<NoWarn>1591</NoWarn>
29-
</PropertyGroup>
30-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
31-
<DebugType>pdbonly</DebugType>
32-
<Optimize>true</Optimize>
33-
<OutputPath>..\..\output\release\GitTools.Core.Tests\net45\</OutputPath>
34-
<DefineConstants>TRACE</DefineConstants>
35-
<ErrorReport>prompt</ErrorReport>
36-
<WarningLevel>4</WarningLevel>
37-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
38-
<NoWarn>1591</NoWarn>
39-
</PropertyGroup>
40-
<ItemGroup>
41-
<Reference Include="Atlassian.Jira, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
42-
<SpecificVersion>False</SpecificVersion>
43-
<HintPath>..\packages\Atlassian.SDK.2.5.0\lib\Atlassian.Jira.dll</HintPath>
44-
</Reference>
45-
<Reference Include="GitTools.Testing, Version=0.2.0.0, Culture=neutral, processorArchitecture=MSIL">
46-
<HintPath>..\packages\GitTools.Testing.0.2.0-beta0001\lib\net4\GitTools.Testing.dll</HintPath>
47-
<Private>True</Private>
48-
</Reference>
49-
<Reference Include="LibGit2Sharp, Version=0.22.0.0, Culture=neutral, processorArchitecture=MSIL">
50-
<HintPath>..\packages\LibGit2Sharp.0.22.0-pre20150716071016\lib\net40\LibGit2Sharp.dll</HintPath>
51-
<Private>True</Private>
52-
</Reference>
53-
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
54-
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
55-
<Private>True</Private>
56-
</Reference>
57-
<Reference Include="Octokit, Version=0.15.0.0, Culture=neutral, processorArchitecture=MSIL">
58-
<HintPath>..\packages\Octokit.0.15.0\lib\net45\Octokit.dll</HintPath>
59-
<Private>True</Private>
60-
</Reference>
61-
<Reference Include="Shouldly, Version=2.6.0.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
62-
<HintPath>..\packages\Shouldly.2.6.0\lib\net40\Shouldly.dll</HintPath>
63-
<Private>True</Private>
64-
</Reference>
65-
<Reference Include="System" />
66-
<Reference Include="System.Core" />
67-
<Reference Include="System.Net.Http" />
68-
<Reference Include="System.Xml.Linq" />
69-
<Reference Include="System.Data.DataSetExtensions" />
70-
<Reference Include="Microsoft.CSharp" />
71-
<Reference Include="System.Data" />
72-
<Reference Include="System.Xml" />
73-
</ItemGroup>
74-
<ItemGroup>
75-
<Compile Include="..\SolutionAssemblyInfo.cs">
76-
<Link>Properties\SolutionAssemblyInfo.cs</Link>
77-
</Compile>
78-
<Compile Include="GitRepositoryTests.cs" />
79-
<Compile Include="Git\Extensions\AuthenticationInfoExtensionsTests.cs" />
80-
<Compile Include="Git\GitDirFinderTests.cs" />
81-
<Compile Include="Git\GitHelperTests.cs" />
82-
<Compile Include="Git\GitRepositoryFactoryTests.cs" />
83-
<Compile Include="GlobalInitialization.cs" />
84-
<Compile Include="ModuleInitializer.cs" />
85-
<Compile Include="Properties\AssemblyInfo.cs" />
86-
</ItemGroup>
87-
<ItemGroup>
88-
<ProjectReference Include="..\GitTools.Core\GitTools.Core.NET40\GitTools.Core.NET40.csproj">
89-
<Project>{C11252F9-0ECA-44DC-860B-E029C04FBD10}</Project>
90-
<Name>GitTools.Core.NET40</Name>
91-
</ProjectReference>
92-
</ItemGroup>
93-
<ItemGroup>
94-
<Content Include="FodyWeavers.xml" />
95-
</ItemGroup>
96-
<ItemGroup>
97-
<None Include="packages.config" />
98-
</ItemGroup>
99-
<ItemGroup />
100-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
101-
<Import Project="..\packages\Fody.1.29.3\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.3\build\dotnet\Fody.targets')" />
102-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
103-
<PropertyGroup>
104-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
105-
</PropertyGroup>
106-
<Error Condition="!Exists('..\packages\Fody.1.29.3\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.3\build\dotnet\Fody.targets'))" />
107-
<Error Condition="!Exists('..\packages\ModuleInit.Fody.1.5.8.0\build\dotnet\ModuleInit.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ModuleInit.Fody.1.5.8.0\build\dotnet\ModuleInit.Fody.targets'))" />
108-
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.72\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.72\build\LibGit2Sharp.NativeBinaries.props'))" />
109-
</Target>
110-
<Import Project="..\packages\ModuleInit.Fody.1.5.8.0\build\dotnet\ModuleInit.Fody.targets" Condition="Exists('..\packages\ModuleInit.Fody.1.5.8.0\build\dotnet\ModuleInit.Fody.targets')" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.72\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.72\build\LibGit2Sharp.NativeBinaries.props')" />
4+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
5+
<PropertyGroup>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8+
<ProjectGuid>{0834BE9B-5CDE-4CAB-A683-C70A7D91450B}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>GitTools.Tests</RootNamespace>
12+
<AssemblyName>GitTools.Core.Tests</AssemblyName>
13+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<LangVersion>5</LangVersion>
16+
<NuGetPackageImportStamp>
17+
</NuGetPackageImportStamp>
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>..\..\output\debug\GitTools.Core.Tests\net45\</OutputPath>
24+
<DefineConstants>TRACE;DEBUG</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
28+
<NoWarn>1591</NoWarn>
29+
</PropertyGroup>
30+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
31+
<DebugType>pdbonly</DebugType>
32+
<Optimize>true</Optimize>
33+
<OutputPath>..\..\output\release\GitTools.Core.Tests\net45\</OutputPath>
34+
<DefineConstants>TRACE</DefineConstants>
35+
<ErrorReport>prompt</ErrorReport>
36+
<WarningLevel>4</WarningLevel>
37+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
38+
<NoWarn>1591</NoWarn>
39+
</PropertyGroup>
40+
<ItemGroup>
41+
<Reference Include="Atlassian.Jira, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
42+
<SpecificVersion>False</SpecificVersion>
43+
<HintPath>..\packages\Atlassian.SDK.2.5.0\lib\Atlassian.Jira.dll</HintPath>
44+
</Reference>
45+
<Reference Include="GitTools.Testing, Version=0.2.0.0, Culture=neutral, processorArchitecture=MSIL">
46+
<HintPath>..\packages\GitTools.Testing.0.2.0-beta0001\lib\net4\GitTools.Testing.dll</HintPath>
47+
<Private>True</Private>
48+
</Reference>
49+
<Reference Include="LibGit2Sharp, Version=0.22.0.0, Culture=neutral, processorArchitecture=MSIL">
50+
<HintPath>..\packages\LibGit2Sharp.0.22.0-pre20150716071016\lib\net40\LibGit2Sharp.dll</HintPath>
51+
<Private>True</Private>
52+
</Reference>
53+
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
54+
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
55+
<Private>True</Private>
56+
</Reference>
57+
<Reference Include="Octokit, Version=0.15.0.0, Culture=neutral, processorArchitecture=MSIL">
58+
<HintPath>..\packages\Octokit.0.15.0\lib\net45\Octokit.dll</HintPath>
59+
<Private>True</Private>
60+
</Reference>
61+
<Reference Include="Shouldly, Version=2.6.0.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
62+
<HintPath>..\packages\Shouldly.2.6.0\lib\net40\Shouldly.dll</HintPath>
63+
<Private>True</Private>
64+
</Reference>
65+
<Reference Include="System" />
66+
<Reference Include="System.Core" />
67+
<Reference Include="System.Net.Http" />
68+
<Reference Include="System.Xml.Linq" />
69+
<Reference Include="System.Data.DataSetExtensions" />
70+
<Reference Include="Microsoft.CSharp" />
71+
<Reference Include="System.Data" />
72+
<Reference Include="System.Xml" />
73+
</ItemGroup>
74+
<ItemGroup>
75+
<Compile Include="..\SolutionAssemblyInfo.cs">
76+
<Link>Properties\SolutionAssemblyInfo.cs</Link>
77+
</Compile>
78+
<Compile Include="GitRepositoryTests.cs" />
79+
<Compile Include="Git\Extensions\AuthenticationInfoExtensionsTests.cs" />
80+
<Compile Include="Git\GitDirFinderTests.cs" />
81+
<Compile Include="Git\GitRepositoryHelperTests.cs" />
82+
<Compile Include="Git\GitRepositoryFactoryTests.cs" />
83+
<Compile Include="GlobalInitialization.cs" />
84+
<Compile Include="ModuleInitializer.cs" />
85+
<Compile Include="Properties\AssemblyInfo.cs" />
86+
</ItemGroup>
87+
<ItemGroup>
88+
<ProjectReference Include="..\GitTools.Core\GitTools.Core.NET40\GitTools.Core.NET40.csproj">
89+
<Project>{C11252F9-0ECA-44DC-860B-E029C04FBD10}</Project>
90+
<Name>GitTools.Core.NET40</Name>
91+
</ProjectReference>
92+
</ItemGroup>
93+
<ItemGroup>
94+
<Content Include="FodyWeavers.xml" />
95+
</ItemGroup>
96+
<ItemGroup>
97+
<None Include="packages.config" />
98+
</ItemGroup>
99+
<ItemGroup />
100+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
101+
<Import Project="..\packages\Fody.1.29.3\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.3\build\dotnet\Fody.targets')" />
102+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
103+
<PropertyGroup>
104+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
105+
</PropertyGroup>
106+
<Error Condition="!Exists('..\packages\Fody.1.29.3\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.3\build\dotnet\Fody.targets'))" />
107+
<Error Condition="!Exists('..\packages\ModuleInit.Fody.1.5.8.0\build\dotnet\ModuleInit.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ModuleInit.Fody.1.5.8.0\build\dotnet\ModuleInit.Fody.targets'))" />
108+
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.72\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.72\build\LibGit2Sharp.NativeBinaries.props'))" />
109+
</Target>
110+
<Import Project="..\packages\ModuleInit.Fody.1.5.8.0\build\dotnet\ModuleInit.Fody.targets" Condition="Exists('..\packages\ModuleInit.Fody.1.5.8.0\build\dotnet\ModuleInit.Fody.targets')" />
111111
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
112112
Other similar extension points exist, see Microsoft.Common.targets.
113113
<Target Name="BeforeBuild">
114114
</Target>
115115
<Target Name="AfterBuild">
116116
</Target>
117-
-->
117+
-->
118118
</Project>

src/GitTools.Core/GitTools.Core.Shared/Git/GitRepositoryFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ static string CreateDynamicRepository(string targetPath, AuthenticationInfo auth
112112
if (Directory.Exists(targetPath))
113113
{
114114
Log.Info("Git repository already exists");
115-
GitHelper.NormalizeGitDirectory(gitDirectory, authentication, noFetch, targetBranch);
115+
GitRepositoryHelper.NormalizeGitDirectory(gitDirectory, authentication, noFetch, targetBranch);
116116

117117
return gitDirectory;
118118
}
119119

120120
CloneRepository(repositoryUrl, gitDirectory, authentication);
121121

122122
// Normalize (download branches) before using the branch
123-
GitHelper.NormalizeGitDirectory(gitDirectory, authentication, noFetch, targetBranch);
123+
GitRepositoryHelper.NormalizeGitDirectory(gitDirectory, authentication, noFetch, targetBranch);
124124

125125
return gitDirectory;
126126
}

0 commit comments

Comments
 (0)