Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Dahlby <kdahlby@jpcycles.com>2012-03-02 20:26:48 +0400
committerKeith Dahlby <kdahlby@jpcycles.com>2012-03-02 20:26:48 +0400
commitb197de87b90b36d2b9c0987af72068454ef09c65 (patch)
tree1e78a8c19afd0e1bb656ac99dd0cac744b4c8982 /LibGit2Sharp
parentb2b187b0633e767de1bb8f20fdc63ba4152dd5c7 (diff)
Rename NamedReference<> to ReferenceWrapper<>
Closes #121
Diffstat (limited to 'LibGit2Sharp')
-rw-r--r--LibGit2Sharp/Branch.cs2
-rw-r--r--LibGit2Sharp/LibGit2Sharp.csproj2
-rw-r--r--LibGit2Sharp/ReferenceWrapper.cs (renamed from LibGit2Sharp/NamedReference.cs)19
-rw-r--r--LibGit2Sharp/Tag.cs2
4 files changed, 19 insertions, 6 deletions
diff --git a/LibGit2Sharp/Branch.cs b/LibGit2Sharp/Branch.cs
index 0160af40..4082a422 100644
--- a/LibGit2Sharp/Branch.cs
+++ b/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 });
diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj
index fa503a12..64760a20 100644
--- a/LibGit2Sharp/LibGit2Sharp.csproj
+++ b/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" />
diff --git a/LibGit2Sharp/NamedReference.cs b/LibGit2Sharp/ReferenceWrapper.cs
index 334bd880..2e70ebdb 100644
--- a/LibGit2Sharp/NamedReference.cs
+++ b/LibGit2Sharp/ReferenceWrapper.cs
@@ -4,12 +4,25 @@ using LibGit2Sharp.Core.Compat;
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 @@ namespace LibGit2Sharp
}
/// <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
{
diff --git a/LibGit2Sharp/Tag.cs b/LibGit2Sharp/Tag.cs
index 38e019df..83764b05 100644
--- a/LibGit2Sharp/Tag.cs
+++ b/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 });