using System; namespace LibGit2Sharp { /// /// A DirectReference points directly to a /// public class DirectReference : Reference { private readonly Lazy targetBuilder; /// /// Needed for mocking purposes. /// protected DirectReference() { } internal DirectReference(string canonicalName, IRepository repo, ObjectId targetId) : base(canonicalName, targetId.Sha) { targetBuilder = new Lazy(() => repo.Lookup(targetId)); } /// /// Gets the target of this /// public virtual GitObject Target { get { return targetBuilder.Value; } } /// /// As a is already peeled, invoking this will return the same . /// /// This instance. public override DirectReference ResolveToDirectReference() { return this; } } }