Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename NamedReference<> to ReferenceWrapper<>

Closes #121
  • Loading branch information...
commit b197de87b90b36d2b9c0987af72068454ef09c65 1 parent b2b187b
@dahlbyk dahlbyk authored
View
2  LibGit2Sharp/Branch.cs
@@ -9,7 +9,7 @@ namespace LibGit2Sharp
/// <summary>
/// A branch is a special kind of reference
/// </summary>
- public class Branch : NamedReference<Commit>, IEquatable<Branch>
+ public class Branch : ReferenceWrapper<Commit>, IEquatable<Branch>
{
private static readonly LambdaEqualityHelper<Branch> equalityHelper =
new LambdaEqualityHelper<Branch>(new Func<Branch, object>[] { x => x.CanonicalName, x => x.Tip });
View
2  LibGit2Sharp/LibGit2Sharp.csproj
@@ -100,7 +100,7 @@
<Compile Include="Filter.cs" />
<Compile Include="IQueryableCommitCollection.cs" />
<Compile Include="Core\LookUpOptions.cs" />
- <Compile Include="NamedReference.cs" />
+ <Compile Include="ReferenceWrapper.cs" />
<Compile Include="ObjectId.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Reference.cs" />
View
19 LibGit2Sharp/NamedReference.cs → LibGit2Sharp/ReferenceWrapper.cs
@@ -4,12 +4,25 @@
namespace LibGit2Sharp
{
- public abstract class NamedReference<TObject> where TObject : GitObject
+ /// <summary>
+ /// A base class for things that wrap a <see cref = "Reference" /> (branch, tag, etc).
+ /// </summary>
+ /// <typeparam name="TObject">The type of the referenced Git object.</typeparam>
+ public abstract class ReferenceWrapper<TObject> where TObject : GitObject
{
+ /// <summary>
+ /// The repo.
+ /// </summary>
protected readonly Repository repo;
private readonly Lazy<TObject> objectBuilder;
- protected internal NamedReference(Repository repo, Reference reference, Func<Reference, string> canonicalNameSelector)
+ /// <summary>
+ /// Initializes a new instance of the <see cref = "ReferenceWrapper{TObject}" /> class.
+ /// </summary>
+ /// <param name="repo">The repo.</param>
+ /// <param name="reference">The reference.</param>
+ /// <param name="canonicalNameSelector">A function to construct the reference's canonical name.</param>
+ protected internal ReferenceWrapper(Repository repo, Reference reference, Func<Reference, string> canonicalNameSelector)
{
Ensure.ArgumentNotNull(repo, "repo");
Ensure.ArgumentNotNull(canonicalNameSelector, "canonicalNameSelector");
@@ -42,7 +55,7 @@ public override string ToString()
}
/// <summary>
- /// Gets the <typeparam name = "TObject" /> this <see cref = "NamedReference{TObject}" /> points to.
+ /// Gets the <typeparam name = "TObject" /> this <see cref = "ReferenceWrapper{TObject}" /> points to.
/// </summary>
protected TObject TargetObject
{
View
2  LibGit2Sharp/Tag.cs
@@ -6,7 +6,7 @@ namespace LibGit2Sharp
/// <summary>
/// A Tag
/// </summary>
- public class Tag : NamedReference<GitObject>, IEquatable<Tag>
+ public class Tag : ReferenceWrapper<GitObject>, IEquatable<Tag>
{
private static readonly LambdaEqualityHelper<Tag> equalityHelper =
new LambdaEqualityHelper<Tag>(new Func<Tag, object>[] { x => x.CanonicalName, x => x.Target });
Please sign in to comment.
Something went wrong with that request. Please try again.