Skip to content

Commit 184c862

Browse files
committed
Merge pull request #362 from JakeGinnivan/Cleanup
Cleanup
2 parents 7af3377 + fee6a2e commit 184c862

File tree

79 files changed

+89
-2322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+89
-2322
lines changed

GitVersion.sln

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.30723.0
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.22512.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersionExe", "GitVersionExe\GitVersionExe.csproj", "{C3578A7B-09A6-4444-9383-0DEAFA4958BD}"
77
EndProject
@@ -26,47 +26,33 @@ EndProject
2626
Global
2727
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2828
Debug|Any CPU = Debug|Any CPU
29-
Debug|x86 = Debug|x86
3029
Release|Any CPU = Release|Any CPU
31-
Release|x86 = Release|x86
3230
EndGlobalSection
3331
GlobalSection(ProjectConfigurationPlatforms) = postSolution
3432
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3533
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
36-
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|x86.ActiveCfg = Debug|Any CPU
3734
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
3835
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|Any CPU.Build.0 = Release|Any CPU
39-
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|x86.ActiveCfg = Release|Any CPU
4036
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4137
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
42-
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Debug|x86.ActiveCfg = Debug|Any CPU
4338
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
4439
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Release|Any CPU.Build.0 = Release|Any CPU
45-
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Release|x86.ActiveCfg = Release|Any CPU
4640
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4741
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
48-
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Debug|x86.ActiveCfg = Debug|Any CPU
4942
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
5043
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Release|Any CPU.Build.0 = Release|Any CPU
51-
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Release|x86.ActiveCfg = Release|Any CPU
5244
{BF905F84-382C-440D-92F5-C61108626D8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5345
{BF905F84-382C-440D-92F5-C61108626D8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
54-
{BF905F84-382C-440D-92F5-C61108626D8D}.Debug|x86.ActiveCfg = Debug|Any CPU
5546
{BF905F84-382C-440D-92F5-C61108626D8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
5647
{BF905F84-382C-440D-92F5-C61108626D8D}.Release|Any CPU.Build.0 = Release|Any CPU
57-
{BF905F84-382C-440D-92F5-C61108626D8D}.Release|x86.ActiveCfg = Release|Any CPU
5848
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5949
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
60-
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Debug|x86.ActiveCfg = Debug|Any CPU
6150
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
6251
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|Any CPU.Build.0 = Release|Any CPU
63-
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|x86.ActiveCfg = Release|Any CPU
6452
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6553
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
66-
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|x86.ActiveCfg = Debug|Any CPU
6754
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
6855
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|Any CPU.Build.0 = Release|Any CPU
69-
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|x86.ActiveCfg = Release|Any CPU
7056
EndGlobalSection
7157
GlobalSection(SolutionProperties) = preSolution
7258
HideSolutionNode = FALSE

GitVersionCore.Tests/GitVersionCore.Tests.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,17 @@
6868
</Reference>
6969
</ItemGroup>
7070
<ItemGroup>
71-
<Compile Include="..\GitVersionTask.Tests\Helpers\DirectoryHelper.cs">
72-
<Link>Helpers\DirectoryHelper.cs</Link>
73-
</Compile>
71+
<Compile Include="BuildServers\BuildServerBaseTests.cs" />
72+
<Compile Include="BuildServers\ContinuaCiTests.cs" />
73+
<Compile Include="BuildServers\MyGetTests.cs" />
74+
<Compile Include="BuildServers\TeamCityTests.cs" />
7475
<Compile Include="Fixtures\CommitCountingRepoFixture.cs" />
7576
<Compile Include="ConfigProviderTests.cs" />
7677
<Compile Include="Fixtures\RemoteRepositoryFixture.cs" />
7778
<Compile Include="GitDirFinderTests.cs" />
7879
<Compile Include="Fixtures\BaseGitFlowRepositoryFixture.cs" />
7980
<Compile Include="GitVersionContextTests.cs" />
81+
<Compile Include="Helpers\DirectoryHelper.cs" />
8082
<Compile Include="IntegrationTests\PullRequestScenarios.cs" />
8183
<Compile Include="IntegrationTests\RemoteRepositoryTests.cs" />
8284
<Compile Include="IntegrationTests\GitFlow\DevelopScenarios.cs" />

GitVersionCore.Tests/IntegrationTests/GitFlow/MetaDataByCommitScenarios.cs

Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using GitVersion;
3-
using GitVersionCore.Tests;
4-
using LibGit2Sharp;
1+
using LibGit2Sharp;
52
using NUnit.Framework;
63
using Shouldly;
74

@@ -80,89 +77,6 @@ public void CanCorrectlyDetectCommitCountsSemVer()
8077
}
8178
}
8279

83-
84-
/*
85-
* hotfix-1.2.1 -----------C--
86-
* / \
87-
* master A----------------F-----H-------N
88-
* \ / \ /
89-
* hotfix-1.3.1 \ / ----L
90-
* \ / \
91-
* release-1.3.0 \ -D----G--- \
92-
* \ / \ \
93-
* develop -----B----E-------I-----M--O--P
94-
* \ /
95-
* feature -------J-K-
96-
*
97-
*
98-
* - A is tagged `1.2.0`
99-
* - F is tagged `1.2.1`
100-
* - H is tagged `1.3.0`
101-
* - N is tagged `1.3.1`
102-
*/
103-
104-
[Test]
105-
public void CanCorrectlyDetectCommitCountsAndReleaseDataWhenThatApplies()
106-
{
107-
using (var f = new CommitCountingRepoFixture())
108-
{
109-
ResetToP(f.Repository);
110-
EnsureBranchMatch(f, "develop");
111-
112-
ResetToO(f.Repository);
113-
EnsureBranchMatch(f, "develop");
114-
115-
ResetToN(f.Repository);
116-
EnsureBranchMatch(f, "master", r => (Commit)r.Tags["1.3.0"].Target);
117-
118-
ResetToM(f.Repository);
119-
EnsureBranchMatch(f, "develop");
120-
121-
ResetToL(f.Repository);
122-
EnsureBranchMatch(f, "hotfix-1.3.1", r => (Commit)r.Tags["1.3.0"].Target);
123-
124-
ResetToK(f.Repository);
125-
EnsureBranchMatch(f, "feature");
126-
127-
ResetToJ(f.Repository);
128-
EnsureBranchMatch(f, "feature");
129-
130-
ResetToI(f.Repository);
131-
EnsureBranchMatch(f, "develop");
132-
133-
ResetToH(f.Repository);
134-
EnsureBranchMatch(f, "master", r => (Commit)r.Tags["1.3.0"].Target);
135-
136-
ResetToG(f.Repository);
137-
EnsureBranchMatch(f, "release-1.3.0");
138-
139-
ResetToF(f.Repository);
140-
EnsureBranchMatch(f, "master", r => (Commit)r.Tags["1.2.0"].Target);
141-
142-
ResetToE(f.Repository);
143-
EnsureBranchMatch(f, "develop");
144-
145-
ResetToD(f.Repository);
146-
EnsureBranchMatch(f, "release-1.3.0");
147-
148-
ResetToC(f.Repository);
149-
EnsureBranchMatch(f, "hotfix-1.2.1", r => (Commit)r.Tags["1.2.0"].Target);
150-
151-
ResetToB(f.Repository);
152-
EnsureBranchMatch(f, "develop");
153-
}
154-
}
155-
156-
static void EnsureBranchMatch(CommitCountingRepoFixture fixture, string branchName, Func<IRepository, Commit> commitFinder = null)
157-
{
158-
var referenceCommitFinder = commitFinder ?? (r => r.FindBranch(branchName).Tip);
159-
160-
var commit = referenceCommitFinder(fixture.Repository);
161-
var releaseDate = LastMinorVersionFinder.Execute(fixture.Repository, new TestEffectiveConfiguration(), commit);
162-
releaseDate.ShouldBe(commit.When());
163-
}
164-
165-
16680
static void EnsureMetaDataMatch(CommitCountingRepoFixture fixture,string expectedSemVer)
16781
{
16882
var result = fixture.ExecuteGitVersion();
Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace GitVersion
22
{
3-
using System;
4-
53
static partial class ExtensionMethods
64
{
75
public static string GetCanonicalBranchName(this string branchName)
@@ -17,70 +15,9 @@ public static string GetCanonicalBranchName(this string branchName)
1715
return string.Format("refs/heads/{0}", branchName);
1816
}
1917

20-
public static bool IsHotfix(this string branchName)
21-
{
22-
return branchName.StartsWith("hotfix-") || branchName.StartsWith("hotfix/");
23-
}
24-
25-
public static string GetHotfixSuffix(this string branchName)
26-
{
27-
return branchName.TrimStart("hotfix-").TrimStart("hotfix/");
28-
}
29-
30-
public static bool IsRelease(this string branchName)
31-
{
32-
return branchName.StartsWith("release-") || branchName.StartsWith("release/");
33-
}
34-
35-
public static string GetReleaseSuffix(this string branchName)
36-
{
37-
return branchName.TrimStart("release-").TrimStart("release/");
38-
}
39-
40-
public static string GetUnknownBranchSuffix(this string branchName)
41-
{
42-
var unknownBranchSuffix = branchName.Split('-', '/');
43-
if (unknownBranchSuffix.Length == 1)
44-
return branchName;
45-
return unknownBranchSuffix[1];
46-
}
47-
48-
public static string GetSuffix(this string branchName, BranchType branchType)
49-
{
50-
switch (branchType)
51-
{
52-
case BranchType.Hotfix:
53-
return branchName.GetHotfixSuffix();
54-
55-
case BranchType.Release:
56-
return branchName.GetReleaseSuffix();
57-
58-
case BranchType.Unknown:
59-
return branchName.GetUnknownBranchSuffix();
60-
61-
default:
62-
throw new NotSupportedException(string.Format("Unexpected branch type {0}.", branchType));
63-
}
64-
}
65-
66-
public static bool IsDevelop(this string branchName)
67-
{
68-
return branchName == "develop";
69-
}
70-
71-
public static bool IsMaster(this string branchName)
72-
{
73-
return branchName == "master";
74-
}
75-
7618
public static bool IsPullRequest(this string branchName)
7719
{
7820
return branchName.Contains("pull/") || branchName.Contains("pull-requests/") || branchName.Contains("pr/");
7921
}
80-
81-
public static bool IsSupport(this string branchName)
82-
{
83-
return branchName.ToLower().StartsWith("support-") || branchName.ToLower().StartsWith("support/");
84-
}
8522
}
8623
}

GitVersionCore/GitFlow/BranchClassifier.cs

Lines changed: 0 additions & 57 deletions
This file was deleted.

GitVersionCore/GitFlow/BranchFinders/BranchCommitDifferenceFinder.cs

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)