File tree Expand file tree Collapse file tree 5 files changed +23
-7
lines changed
GitVersionCore.Tests/Mocks
VersionCalculation/BaseVersionCalculators Expand file tree Collapse file tree 5 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 1
1
using LibGit2Sharp ;
2
+ using Tag = GitVersion . Tag ;
2
3
3
4
namespace GitVersionCore . Tests . Mocks
4
5
{
Original file line number Diff line number Diff line change 1
1
using System . Collections . Generic ;
2
- using LibGit2Sharp ;
3
- using TagCollection = GitVersion . TagCollection ;
2
+ using GitVersion ;
4
3
5
4
namespace GitVersionCore . Tests . Mocks
6
5
{
Original file line number Diff line number Diff line change 2
2
using System . Collections . Generic ;
3
3
using GitVersion . Model . Configuration ;
4
4
using GitVersion . VersionCalculation ;
5
- using LibGit2Sharp ;
6
5
7
6
namespace GitVersion . Common
8
7
{
Original file line number Diff line number Diff line change 6
6
7
7
namespace GitVersion
8
8
{
9
+ public class Tag
10
+ {
11
+ private readonly LibGit2Sharp . Tag innerTag ;
12
+ private Tag ( LibGit2Sharp . Tag tag )
13
+ {
14
+ innerTag = tag ;
15
+ }
16
+
17
+ protected Tag ( )
18
+ {
19
+ }
20
+ public static implicit operator LibGit2Sharp . Tag ( Tag d ) => d ? . innerTag ;
21
+ public static explicit operator Tag ( LibGit2Sharp . Tag b ) => b is null ? null : new Tag ( b ) ;
22
+
23
+ public virtual GitObject Target => innerTag ? . Target ;
24
+ public virtual string FriendlyName => innerTag ? . FriendlyName ;
25
+ public virtual TagAnnotation Annotation => innerTag ? . Annotation ;
26
+ }
9
27
public class Commit
10
28
{
11
29
private static readonly LambdaEqualityHelper < Commit > equalityHelper =
@@ -119,12 +137,12 @@ protected TagCollection()
119
137
120
138
public virtual IEnumerator < Tag > GetEnumerator ( )
121
139
{
122
- foreach ( var branch in innerCollection )
123
- yield return branch ;
140
+ foreach ( var tag in innerCollection )
141
+ yield return ( Tag ) tag ;
124
142
}
125
143
126
144
IEnumerator IEnumerable . GetEnumerator ( ) => GetEnumerator ( ) ;
127
- public virtual Tag this [ string name ] => innerCollection [ name ] ;
145
+ public virtual Tag this [ string name ] => ( Tag ) innerCollection [ name ] ;
128
146
}
129
147
130
148
public class ReferenceCollection : IEnumerable < Reference >
Original file line number Diff line number Diff line change 3
3
using System . Linq ;
4
4
using GitVersion . Common ;
5
5
using GitVersion . Extensions ;
6
- using LibGit2Sharp ;
7
6
8
7
namespace GitVersion . VersionCalculation
9
8
{
You can’t perform that action at this time.
0 commit comments