Skip to content

Commit 54f6d0d

Browse files
committed
cleanup
1 parent d3947f1 commit 54f6d0d

14 files changed

+35
-36
lines changed

AcceptanceTests/CommitCountingRepoFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public CommitCountingRepoFixture() :
1010
base(CloneTestRepo)
1111
{ }
1212

13-
private static IRepository CloneTestRepo(string path)
13+
static IRepository CloneTestRepo(string path)
1414
{
1515
const string repoName = "commit_counting_wd";
1616
var source = new DirectoryInfo(@"../../Resources/" + repoName);

AcceptanceTests/EmptyRepositoryFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public EmptyRepositoryFixture() :
99
base(CreateNewRepository)
1010
{ }
1111

12-
private static IRepository CreateNewRepository(string path)
12+
static IRepository CreateNewRepository(string path)
1313
{
1414
LibGit2Sharp.Repository.Init(path);
1515
Console.WriteLine("Created git repository at '{0}'", path);

AcceptanceTests/RepositoryFixtureBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ namespace AcceptanceTests
77

88
public abstract class RepositoryFixtureBase : IDisposable
99
{
10-
public readonly string RepositoryPath;
11-
public readonly IRepository Repository;
10+
public string RepositoryPath;
11+
public IRepository Repository;
1212

1313
protected RepositoryFixtureBase(Func<string, IRepository> repoBuilder)
1414
{

GitVersionCore/BuildServers/TeamCity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
public class TeamCity : BuildServerBase
66
{
7-
readonly Arguments arguments;
7+
Arguments arguments;
88

99
public TeamCity(Arguments arguments)
1010
{

GitVersionCore/LambdaEqualityHelper.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ namespace GitVersion
55
// From the LibGit2Sharp project (libgit2sharp.com)
66
// MIT License - Copyright (c) 2011-2014 LibGit2Sharp contributors
77
// see https://github.com/libgit2/libgit2sharp/blob/7af5c60f22f9bd6064204f84467cfa62bedd1147/LibGit2Sharp/Core/LambdaEqualityHelper.cs
8-
9-
internal class LambdaEqualityHelper<T>
8+
class LambdaEqualityHelper<T>
109
{
11-
private readonly Func<T, object>[] equalityContributorAccessors;
10+
Func<T, object>[] equalityContributorAccessors;
1211

1312
public LambdaEqualityHelper(params Func<T, object>[] equalityContributorAccessors)
1413
{

GitVersionCore/ReleaseDate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class ReleaseDate : IEquatable<ReleaseDate>
88
public DateTimeOffset Date;
99
public string CommitSha;
1010

11-
private static readonly LambdaEqualityHelper<ReleaseDate> equalityHelper =
11+
static LambdaEqualityHelper<ReleaseDate> equalityHelper =
1212
new LambdaEqualityHelper<ReleaseDate>(x => x.OriginalDate, x => x.OriginalCommitSha, x => x.Date, x => x.CommitSha);
1313

1414
public override bool Equals(object obj)

GitVersionCore/SemanticVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace GitVersion
55

66
public class SemanticVersion : IFormattable, IComparable<SemanticVersion>
77
{
8-
static readonly Regex ParseSemVer = new Regex(
8+
static Regex ParseSemVer = new Regex(
99
@"[vV]?(?<SemVer>(?<Major>\d+)(\.(?<Minor>\d+))?(\.(?<Patch>\d+))?)(\.(?<FourthPart>\d+))?(-(?<Tag>[^\+]*))?(\+(?<BuildMetaData>.*))?",
1010
RegexOptions.Compiled);
1111

GitVersionCore/SemanticVersionBuildMetaData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace GitVersion
55

66
public class SemanticVersionBuildMetaData : IFormattable, IEquatable<SemanticVersionBuildMetaData>
77
{
8-
static readonly Regex ParseRegex = new Regex(
8+
static Regex ParseRegex = new Regex(
99
@"(?<BuildNumber>\d+)?(\.?Branch(Name)?\.(?<BranchName>[^\.]+))?(\.?Sha?\.(?<Sha>[^\.]+))?(?<Other>.*)",
1010
RegexOptions.Compiled | RegexOptions.IgnoreCase);
1111

12-
private static readonly LambdaEqualityHelper<SemanticVersionBuildMetaData> equalityHelper =
12+
static LambdaEqualityHelper<SemanticVersionBuildMetaData> equalityHelper =
1313
new LambdaEqualityHelper<SemanticVersionBuildMetaData>(x => x.CommitsSinceTag, x => x.Branch, x => x.Sha, x => x.ReleaseDate);
1414

1515
public int? CommitsSinceTag;

GitVersionCore/SemanticVersionPreReleaseTag.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class SemanticVersionPreReleaseTag :
99
public string Name;
1010
public int? Number;
1111

12-
private static readonly LambdaEqualityHelper<SemanticVersionPreReleaseTag> equalityHelper =
12+
static LambdaEqualityHelper<SemanticVersionPreReleaseTag> equalityHelper =
1313
new LambdaEqualityHelper<SemanticVersionPreReleaseTag>(x => x.Name, x => x.Number);
1414

1515
public SemanticVersionPreReleaseTag()

GitVersionExe/AssemblyInfoFileUpdate.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ namespace GitVersion
44
using System.Collections.Generic;
55
using System.IO;
66

7-
internal class AssemblyInfoFileUpdate : IDisposable
7+
class AssemblyInfoFileUpdate : IDisposable
88
{
9-
private readonly List<Action> _restoreBackupTasks = new List<Action>();
10-
private readonly List<Action> _cleanupBackupTasks = new List<Action>();
9+
List<Action> restoreBackupTasks = new List<Action>();
10+
List<Action> cleanupBackupTasks = new List<Action>();
1111

1212
public AssemblyInfoFileUpdate(Arguments args, string workingDirectory, Dictionary<string, string> variables)
1313
{
@@ -24,13 +24,13 @@ public AssemblyInfoFileUpdate(Arguments args, string workingDirectory, Dictionar
2424
var backupAssemblyInfo = assemblyInfoFile + ".bak";
2525
var localAssemblyInfo = assemblyInfoFile;
2626
File.Copy(assemblyInfoFile, backupAssemblyInfo, true);
27-
_restoreBackupTasks.Add(() =>
27+
restoreBackupTasks.Add(() =>
2828
{
2929
if (File.Exists(localAssemblyInfo))
3030
File.Delete(localAssemblyInfo);
3131
File.Move(backupAssemblyInfo, localAssemblyInfo);
3232
});
33-
_cleanupBackupTasks.Add(() => File.Delete(backupAssemblyInfo));
33+
cleanupBackupTasks.Add(() => File.Delete(backupAssemblyInfo));
3434

3535
var assemblyVersion = string.Format("{0}.{1}.0.0", variables[VariableProvider.Major], variables[VariableProvider.Minor]);
3636
var assemblyInfoVersion = variables[VariableProvider.InformationalVersion];
@@ -46,23 +46,23 @@ public AssemblyInfoFileUpdate(Arguments args, string workingDirectory, Dictionar
4646

4747
public void Dispose()
4848
{
49-
foreach (var restoreBackup in _restoreBackupTasks)
49+
foreach (var restoreBackup in restoreBackupTasks)
5050
{
5151
restoreBackup();
5252
}
5353

54-
_cleanupBackupTasks.Clear();
55-
_restoreBackupTasks.Clear();
54+
cleanupBackupTasks.Clear();
55+
restoreBackupTasks.Clear();
5656
}
5757

5858
public void DoNotRestoreAssemblyInfo()
5959
{
60-
foreach (var cleanupBackupTask in _cleanupBackupTasks)
60+
foreach (var cleanupBackupTask in cleanupBackupTasks)
6161
{
6262
cleanupBackupTask();
6363
}
64-
_cleanupBackupTasks.Clear();
65-
_restoreBackupTasks.Clear();
64+
cleanupBackupTasks.Clear();
65+
restoreBackupTasks.Clear();
6666
}
6767
}
6868
}

0 commit comments

Comments
 (0)