@@ -15,6 +15,7 @@ public abstract class Reference : IEquatable<Reference>
15
15
private static readonly LambdaEqualityHelper < Reference > equalityHelper =
16
16
new LambdaEqualityHelper < Reference > ( x => x . CanonicalName , x => x . TargetIdentifier ) ;
17
17
18
+ private readonly IRepository repo ;
18
19
private readonly string canonicalName ;
19
20
private readonly string targetIdentifier ;
20
21
@@ -29,8 +30,19 @@ protected Reference()
29
30
/// </summary>
30
31
/// <param name="canonicalName">The canonical name.</param>
31
32
/// <param name="targetIdentifier">The target identifier.</param>
33
+ [ Obsolete ( "This ctor will be removed in a future release." ) ]
32
34
protected Reference ( string canonicalName , string targetIdentifier )
35
+ : this ( null , canonicalName , targetIdentifier )
33
36
{
37
+ }
38
+
39
+ /// <remarks>
40
+ /// This would be protected+internal, were that supported by C#.
41
+ /// Do not use except in subclasses.
42
+ /// </remarks>
43
+ internal Reference ( IRepository repo , string canonicalName , string targetIdentifier )
44
+ {
45
+ this . repo = repo ;
34
46
this . canonicalName = canonicalName ;
35
47
this . targetIdentifier = targetIdentifier ;
36
48
}
@@ -48,7 +60,7 @@ internal static T BuildFromPtr<T>(ReferenceSafeHandle handle, Repository repo) w
48
60
string targetIdentifier = Proxy . git_reference_symbolic_target ( handle ) ;
49
61
50
62
var targetRef = repo . Refs [ targetIdentifier ] ;
51
- reference = new SymbolicReference ( name , targetIdentifier , targetRef ) ;
63
+ reference = new SymbolicReference ( repo , name , targetIdentifier , targetRef ) ;
52
64
break ;
53
65
54
66
case GitReferenceType . Oid :
0 commit comments