File tree Expand file tree Collapse file tree 11 files changed +14
-61
lines changed
src/GitVersion.LibGit2Sharp/Git Expand file tree Collapse file tree 11 files changed +14
-61
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,8 @@ namespace GitVersion
6
6
{
7
7
internal class Branch : IBranch
8
8
{
9
- private static readonly LambdaEqualityHelper < IBranch > equalityHelper =
10
- new LambdaEqualityHelper < IBranch > ( x => x . CanonicalName ) ;
11
- private static readonly LambdaKeyComparer < IBranch , string > comparerHelper =
12
- new LambdaKeyComparer < IBranch , string > ( x => x . CanonicalName ) ;
9
+ private static readonly LambdaEqualityHelper < IBranch > equalityHelper = new ( x => x . CanonicalName ) ;
10
+ private static readonly LambdaKeyComparer < IBranch , string > comparerHelper = new ( x => x . CanonicalName ) ;
13
11
14
12
private readonly LibGit2Sharp . Branch innerBranch ;
15
13
@@ -18,9 +16,6 @@ internal Branch(LibGit2Sharp.Branch branch)
18
16
innerBranch = branch ;
19
17
}
20
18
21
- protected Branch ( )
22
- {
23
- }
24
19
public int CompareTo ( IBranch other ) => comparerHelper . Compare ( this , other ) ;
25
20
public override bool Equals ( object obj ) => Equals ( obj as IBranch ) ;
26
21
public bool Equals ( IBranch other ) => equalityHelper . Equals ( this , other ) ;
@@ -53,7 +48,6 @@ public virtual ICommitCollection Commits
53
48
{
54
49
get
55
50
{
56
-
57
51
var commits = innerBranch . Commits ;
58
52
return commits is null ? null : new CommitCollection ( commits ) ;
59
53
}
Original file line number Diff line number Diff line change @@ -9,10 +9,6 @@ internal class BranchCollection : IBranchCollection
9
9
private readonly LibGit2Sharp . BranchCollection innerCollection ;
10
10
internal BranchCollection ( LibGit2Sharp . BranchCollection collection ) => innerCollection = collection ;
11
11
12
- protected BranchCollection ( )
13
- {
14
- }
15
-
16
12
public virtual IEnumerator < IBranch > GetEnumerator ( )
17
13
{
18
14
return innerCollection . Select ( branch => new Branch ( branch ) ) . GetEnumerator ( ) ;
Original file line number Diff line number Diff line change @@ -6,10 +6,8 @@ namespace GitVersion
6
6
{
7
7
internal class Commit : ICommit
8
8
{
9
- private static readonly LambdaEqualityHelper < ICommit > equalityHelper =
10
- new LambdaEqualityHelper < ICommit > ( x => x . Id ) ;
11
- private static readonly LambdaKeyComparer < ICommit , string > comparerHelper =
12
- new LambdaKeyComparer < ICommit , string > ( x => x . Sha ) ;
9
+ private static readonly LambdaEqualityHelper < ICommit > equalityHelper = new ( x => x . Id ) ;
10
+ private static readonly LambdaKeyComparer < ICommit , string > comparerHelper = new ( x => x . Sha ) ;
13
11
14
12
private readonly LibGit2Sharp . Commit innerObjectId ;
15
13
@@ -18,10 +16,6 @@ internal Commit(LibGit2Sharp.Commit objectId)
18
16
innerObjectId = objectId ;
19
17
}
20
18
21
- protected Commit ( )
22
- {
23
- }
24
-
25
19
public int CompareTo ( ICommit other ) => comparerHelper . Compare ( this , other ) ;
26
20
public override bool Equals ( object obj ) => Equals ( obj as ICommit ) ;
27
21
public bool Equals ( ICommit other ) => equalityHelper . Equals ( this , other ) ;
Original file line number Diff line number Diff line change @@ -11,10 +11,6 @@ internal class CommitCollection : ICommitCollection
11
11
private readonly ICommitLog innerCollection ;
12
12
internal CommitCollection ( ICommitLog collection ) => innerCollection = collection ;
13
13
14
- protected CommitCollection ( )
15
- {
16
- }
17
-
18
14
public virtual IEnumerator < ICommit > GetEnumerator ( )
19
15
{
20
16
return innerCollection . Select ( commit => new Commit ( commit ) ) . GetEnumerator ( ) ;
Original file line number Diff line number Diff line change @@ -229,14 +229,14 @@ private void AddMissingRefSpecs(LibGit2Sharp.Remote remote)
229
229
230
230
private static FetchOptions GetFetchOptions ( AuthenticationInfo auth )
231
231
{
232
- return new FetchOptions
232
+ return new ( )
233
233
{
234
234
CredentialsProvider = GetCredentialsProvider ( auth )
235
235
} ;
236
236
}
237
237
private static CloneOptions GetCloneOptions ( AuthenticationInfo auth )
238
238
{
239
- return new CloneOptions
239
+ return new ( )
240
240
{
241
241
Checkout = false ,
242
242
CredentialsProvider = GetCredentialsProvider ( auth )
Original file line number Diff line number Diff line change @@ -4,10 +4,8 @@ namespace GitVersion
4
4
{
5
5
internal class ObjectId : IObjectId
6
6
{
7
- private static readonly LambdaEqualityHelper < IObjectId > equalityHelper =
8
- new LambdaEqualityHelper < IObjectId > ( x => x . Sha ) ;
9
- private static readonly LambdaKeyComparer < IObjectId , string > comparerHelper =
10
- new LambdaKeyComparer < IObjectId , string > ( x => x . Sha ) ;
7
+ private static readonly LambdaEqualityHelper < IObjectId > equalityHelper = new ( x => x . Sha ) ;
8
+ private static readonly LambdaKeyComparer < IObjectId , string > comparerHelper = new ( x => x . Sha ) ;
11
9
12
10
private readonly LibGit2Sharp . ObjectId innerObjectId ;
13
11
internal ObjectId ( LibGit2Sharp . ObjectId objectId )
Original file line number Diff line number Diff line change @@ -5,10 +5,8 @@ namespace GitVersion
5
5
{
6
6
internal class Reference : IReference
7
7
{
8
- private static readonly LambdaEqualityHelper < IReference > equalityHelper =
9
- new LambdaEqualityHelper < IReference > ( x => x . CanonicalName ) ;
10
- private static readonly LambdaKeyComparer < IReference , string > comparerHelper =
11
- new LambdaKeyComparer < IReference , string > ( x => x . CanonicalName ) ;
8
+ private static readonly LambdaEqualityHelper < IReference > equalityHelper = new ( x => x . CanonicalName ) ;
9
+ private static readonly LambdaKeyComparer < IReference , string > comparerHelper = new ( x => x . CanonicalName ) ;
12
10
13
11
internal readonly LibGit2Sharp . Reference innerReference ;
14
12
private DirectReference directReference => innerReference . ResolveToDirectReference ( ) ;
@@ -18,10 +16,6 @@ internal Reference(LibGit2Sharp.Reference reference)
18
16
innerReference = reference ;
19
17
}
20
18
21
- protected Reference ( )
22
- {
23
- }
24
-
25
19
public int CompareTo ( IReference other ) => comparerHelper . Compare ( this , other ) ;
26
20
public override bool Equals ( object obj ) => Equals ( obj as IReference ) ;
27
21
public bool Equals ( IReference other ) => equalityHelper . Equals ( this , other ) ;
Original file line number Diff line number Diff line change @@ -9,10 +9,6 @@ internal class ReferenceCollection : IReferenceCollection
9
9
private readonly LibGit2Sharp . ReferenceCollection innerCollection ;
10
10
internal ReferenceCollection ( LibGit2Sharp . ReferenceCollection collection ) => innerCollection = collection ;
11
11
12
- protected ReferenceCollection ( )
13
- {
14
- }
15
-
16
12
public virtual IEnumerator < IReference > GetEnumerator ( )
17
13
{
18
14
return innerCollection . Select ( reference => new Reference ( reference ) ) . GetEnumerator ( ) ;
Original file line number Diff line number Diff line change @@ -5,10 +5,8 @@ namespace GitVersion
5
5
{
6
6
internal class Remote : IRemote
7
7
{
8
- private static readonly LambdaEqualityHelper < IRemote > equalityHelper =
9
- new LambdaEqualityHelper < IRemote > ( x => x . Name ) ;
10
- private static readonly LambdaKeyComparer < IRemote , string > comparerHelper =
11
- new LambdaKeyComparer < IRemote , string > ( x => x . Name ) ;
8
+ private static readonly LambdaEqualityHelper < IRemote > equalityHelper = new ( x => x . Name ) ;
9
+ private static readonly LambdaKeyComparer < IRemote , string > comparerHelper = new ( x => x . Name ) ;
12
10
13
11
private readonly LibGit2Sharp . Remote innerRemote ;
14
12
@@ -17,10 +15,6 @@ internal Remote(LibGit2Sharp.Remote remote)
17
15
innerRemote = remote ;
18
16
}
19
17
20
- protected Remote ( )
21
- {
22
- }
23
-
24
18
public int CompareTo ( IRemote other ) => comparerHelper . Compare ( this , other ) ;
25
19
public override bool Equals ( object obj ) => Equals ( obj as IRemote ) ;
26
20
public bool Equals ( IRemote other ) => equalityHelper . Equals ( this , other ) ;
Original file line number Diff line number Diff line change @@ -5,21 +5,15 @@ namespace GitVersion
5
5
{
6
6
internal class Tag : ITag
7
7
{
8
- private static readonly LambdaEqualityHelper < ITag > equalityHelper =
9
- new LambdaEqualityHelper < ITag > ( x => x . CanonicalName ) ;
10
- private static readonly LambdaKeyComparer < ITag , string > comparerHelper =
11
- new LambdaKeyComparer < ITag , string > ( x => x . CanonicalName ) ;
8
+ private static readonly LambdaEqualityHelper < ITag > equalityHelper = new ( x => x . CanonicalName ) ;
9
+ private static readonly LambdaKeyComparer < ITag , string > comparerHelper = new ( x => x . CanonicalName ) ;
12
10
13
11
private readonly LibGit2Sharp . Tag innerTag ;
14
12
internal Tag ( LibGit2Sharp . Tag tag )
15
13
{
16
14
innerTag = tag ;
17
15
}
18
16
19
- protected Tag ( )
20
- {
21
- }
22
-
23
17
public int CompareTo ( ITag other ) => comparerHelper . Compare ( this , other ) ;
24
18
public override bool Equals ( object obj ) => Equals ( obj as ITag ) ;
25
19
public bool Equals ( ITag other ) => equalityHelper . Equals ( this , other ) ;
You can’t perform that action at this time.
0 commit comments